0

I putted an .html page in a src folder of project in order to display this page on runtime.

But I get an error on runtime that say:- Error connecting to stream.

  import javax.microedition.midlet.*;


  public class HtmlMidlet 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("jar://src/ahlam.html");

      form.addComponent(htmlC);

      form.setScrollable(true);

      form.show( );

  }

  public void pauseApp()
   {   

   }  
 public void destroyApp(boolean unconditional) 
   {

   }

   }
PHPFan
  • 756
  • 3
  • 12
  • 46

1 Answers1

0

I think that the way that you are using to open your file is not the proper way. Is this html page in your folder? Where is your page? the root directory is /src from your project, why are you using jar:... try /ahlam.html only

Take a look on this page for more info and examples HTML Component

Mun0n
  • 4,438
  • 4
  • 28
  • 46