2013-08-20 63 views
1

這是我的代碼。我無法從此矢量對象創建圖像。無法通過com.sun.lwuit.image.createimage從矢量對象創建圖像

Hashtable metaData = new Hashtable(); 

Vector Ad = IADView.getBannerAdData(LwuitAd.this, "MyCompany_MyApp", metaData); 
Object retImg = null; 

if (null != Ad) { 
    retImg = Ad.elementAt(0); 
} 

if (retImg != null) { 
    com.sun.lwuit.Image img = com.sun.lwuit.Image.createImage(Ad.elementAt(0));// it shows error in this line 
    Button buttonAd = new Button(); 
    buttonAd.setIcon(img); 
    f.addComponent(BorderLayout.NORTH, buttonAd); 
    f.show(); 
} else { 
    System.out.println("retImg is null"); 
} 

回答