代码之家  ›  专栏  ›  技术社区  ›  YLG

j2me中lwuit中HttpRequestHandler的Jar文件

  •  2
  • YLG  · 技术社区  · 13 年前

    我需要在j2me模拟器中打开一个网页。由于我有流,我可以通过使用HTMLComponent来做到这一点。但是我不能用这个HttpRequestHandler类在Lwuit中的j2me中创建处理程序,有人能告诉我我的j2me缺少什么吗?如果有任何JAR文件可以使用它,那么给我使用它的建议。然后我也尝试了相同的DocumentRequestHandler而不是HttpRequestHandler,但它向我展示了模拟器“连接流时出错”

    我的代码是:

             DocumentRequestHandler handler=new DocumentRequestHandler() {
    
            public InputStream resourceRequested(DocumentInfo di) {
              return null;
                //           throw new UnsupportedOperationException("Not supported yet.");
            }
        };
     HTMLComponent htmlc=new HTMLComponent(handler);
     htmlc.setPage("http://facebook.com");
     addComponent(htmlc);
     show();
    

    在这段代码中,我需要在DocumentRequestHandler中返回什么?

    1 回复  |  直到 13 年前
        1
  •  3
  •   Telmo Pimentel Mota    13 年前

    您要查找的类可在LWUITBrowser示例应用程序中找到,并且可以从MIDP/applications下的LWUITSVN中检出。

    推荐文章