0
我在LWUIT瀏覽器示例中使用HttpRequestHandler。當我初始化HttpRequestHandler時,我得到java.lang.Error:靜態初始化程序:java.lang.NullPointerException。這是我在startApp中的代碼。 公共無效的startApp(){lwuit httprequesthandler拋出java.lang.Error:靜態初始值設定項:java/lang/NullPointerException
Display.init(this);
try {
InputStream imageStream= Home.class.getResourceAsStream("tipster.res");
//String filesPathAndName = url.getPath();
Resources r = Resources.open(imageStream);
UIManager.getInstance().setThemeProps(r.getTheme("Theme 2"));
} catch (IOException ioe) {
ioe.printStackTrace();
// Do something here.
}
HttpRequestHandler handler = new HttpRequestHandler();
HTMLComponent h = new HTMLComponent(handler);
h.setPage("http://m.google.com");
ffForm.addComponent(h);
}
謝謝阿吉博拉它適合我。 – 2012-10-03 05:41:44