codename one error java.lang.NoSuchMethodError:javafx.scene.web.WebEngine.setUserDataDirectory(Ljava / io / File;)V

时间:2016-02-08 19:34:52

标签: java html parsing codenameone

运行CN1项目时收到此错误

java.lang.NoSuchMethodError: javafx.scene.web.WebEngine.setUserDataDirectory(Ljava/io/File;)V

我使用侧边栏菜单,但错误在主屏幕上 这是我的SateMachine.java

  @Override
protected void beforePortada(Form f) {
  WebBrowser browser=new WebBrowser();
    f.setLayout(new BorderLayout());
    f.addComponent(BorderLayout.CENTER, browser);


    String URL= "someurl.php";

    String ssurhtml = "somehtml";

    ConnectionRequest req = new ConnectionRequest();
    req.setUrl(URL);
    NetworkManager.getInstance().addToQueueAndWait(req);
    byte[] data = req.getResponseData();
    if (data == null) {
        //throw new IOException("Network Error, try again later.");
    }
    //JSONParser parser = new JSONParser();
    // Map response = parser.parseJSON(new InputStreamReader(new ByteArrayInputStream(data), "UTF-8"));


    XMLParser xmlParser=new XMLParser();
    Element element= null;
    try {
        element = xmlParser.parse(new InputStreamReader(new ByteArrayInputStream(data), "ISO8859-1"));
    } catch (UnsupportedEncodingException e) {
        e.printStackTrace();
    }
    Element element1=element.getElementById("somediv");
    String test= String.valueOf(element1);

    char c= '\'';
    char r= ' ';

    test=test.replace(c,r);
    test=(ssurhtml+test+"</body></html>");
    browser.setPage(test,null);
}

我收到错误消息,模拟器显示黑屏

1 个答案:

答案 0 :(得分:1)

当前模拟器中存在需要Java 8的回归。尝试升级到Java 8以解决它。