0

I have a LWUIT app that should load and display html pages .

So I have putted a html file in src dir ( the same dir of my java class )

returns

To display html files I use HtmlComponent widget.

But The Html page not displayed after application running!

returns

Is there an error in setting the path of html file ?

 import com.sun.lwuit.layouts.*;


     import javax.microedition.midlet.*;


     public class HelloLWUITMidlet3 extends MIDlet

     {

       public void startApp()
    {
    com.sun.lwuit.Display.init(this);

    final com.sun.lwuit.Form form = new com.sun.lwuit.Form("");

    final com.sun.lwuit.html.HTMLComponent htmlC = new com.sun.lwuit.html.HTMLComponent( );


     htmlC.setRTL(true);

    htmlC.setPage("file://ahlam.html");

    form.addComponent(htmlC);


    BorderLayout bl = new BorderLayout();

    form.setScrollable(true);


    form.show( );

   }

  public void pauseApp() 
  {

  }

 public void destroyApp(boolean unconditional) {


 }


 }
PHPFan
  • 756
  • 3
  • 12
  • 46

1 Answers1

0

To display html files inside the jar you can use

htmlC.setPage("jar:///ahlam.html");

My file was at the root of the source directory.

igordsm
  • 464
  • 2
  • 8