我有一个HTML字符串:
String html="<p><img border=\"1\" align=\"left\" width=\"150\" vspace=\"2\" hspace=\"2\" height=\"159\" src=/"tmdbuserfiles/ntr-vv-vinayak-pics.jpg\" alt=\"Prithvi II, ballistic missile, DRDO, armed forces,Chandipur, Balasore district, Odisha State\" />The Strategic Forces Command of the armed forces successfully flight-tested the surface-to-surface Prithvi II missile from Chandipur in Balasore </P>";
我想要显示的文本,以及对我的LWUIT形式的银幕形象,对于我的要求,我用下面的代码:
public class LwuitMidlet extends MIDlet {
public void startApp() {
Display.init(this);
Form f = new Form("Hello, LWUIT!");
String html="<p><img border=\"1\" align=\"left\" width=\"150\" vspace=\"2\" hspace=\"2\" height=\"159\" src=www.teluguone.com/tmdbuserfiles/ntr-vv-vinayak-pics.jpg\" alt=\"Prithvi II, ballistic missile, DRDO, armed forces,Chandipur, Balasore district, Odisha State\" />The Strategic Forces Command of the armed forces successfully flight-tested the surface-to-surface Prithvi II missile from Chandipur in Balasore </P>";
HTMLComponent com=new HTMLComponent();
com.setPreferredSize(new Dimension(300,300));
com.setHTML(html, null, null, false);
com.setShowImages(true);
//com.setHTML(image, null, null, false);
f.addComponent(com);
f.show();
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
}
如果我使用上面的代码,我能够只显示文本 ,但我不能够显示图像 ,我测试过我的应用程序上的诺基亚SDK 2.O和SDK 3.0.5
谁能帮我?