LWUIT HtmlComponent

Posted by Pavan Kumar Ragi on Stack Overflow See other posts from Stack Overflow or by Pavan Kumar Ragi
Published on 2012-10-13T08:36:10Z Indexed on 2012/10/24 17:01 UTC
Read the original article Hit count: 397

Filed under:
|

I've an Html String:

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>";

I want to display the text as well as Image on my LWUIT Form Screen,For my Requirement I've used the below code:

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) {
    }
}

If i use the above code,I'm able to display only the text,but i'm not able to display the image,I've tested my app on Nokia SDK 2.O and SDK 3.0.5

can any one help me?

© Stack Overflow or respective owner

Related posts about java-me

Related posts about lwuit