我需要在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中返回什么?