0

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

So I had created a html page and putted in src dir ( the same dir of my java class)

returns

To load the page I used htmlC.setPage("jar:///mypage.html");

returns

But I have got the error

No BODY tag was found in page.

import com.sun.lwuit.layouts.*;

import  com.sun.lwuit.html.*;

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(   );

   

   DocumentInfo docInfo = htmlC.getDocumentInfo() ;

   DocumentRequestHandler handler =htmlC.getRequestHandler();

   htmlC.setRTL(true);


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

    form.addComponent(htmlC);


    BorderLayout bl = new BorderLayout();

    form.setScrollable(true);


    form.show( );

  }

  public void pauseApp()
  {

  }

 public void destroyApp(boolean unconditional) {


 }


 }
Community
  • 1
  • 1
PHPFan
  • 756
  • 3
  • 12
  • 46

1 Answers1

0

It seems the html file does not have a body tag, either include it or you can get the contents and wrap it in a body tag.

Ajibola
  • 1,218
  • 16
  • 28
  • @Shai_Almog No I am sure to include body tag , and I had tested the web page before ran the code – PHPFan Aug 18 '13 at 12:55