i am getting a ClassCastException when i try to cast to cast into com.sun.lwuit.Image .Please help on how i can change the code below to use in LWUIT
public void vservAdReceived(Object obj)
{
if(obj==vservAd)
{
if(((VservAd)obj).getAdType().equals(VservAd.AD_TYPE_IMAGE))
{
com.sun.lwuit.Image imageAd=(com.sun.lwuit.Image)((VservAd)obj).getAd();
//use image as com.sun.lwuit.Button icon
}
else if(((VservAd)obj).getAdType().equals(VservAd.AD_TYPE_TEXT))
{
String textAd=(String)((VservAd)obj).getAd();
//use image as com.sun.lwuit.Button text
}
}
}