有人可以就如何从 loadContent() 将以下内容加载到 webviewer 提供一些建议吗?
http://jsbin.com/aqupun/6/edit
我试图做这样的事情,但它似乎不起作用。谢谢!
Scanner sc1 = new Scanner(new File("src/web/web.html"));
String webStr = sc1.useDelimiter("\\Z").next();
Scanner sc2 = new Scanner(new File("src/web/data.js"));
String dataStr = sc2.useDelimiter("\\Z").next();
Scanner sc3 = new Scanner(new File("src/web/cytoscape.min.js"));
String cytoStr = sc3.useDelimiter("\\Z").next();
Scanner sc4 = new Scanner(new File("src/web/jquery.min.js"));
String jqueryStr = sc4.useDelimiter("\\Z").next();
webEngine.loadContent(cytoStr, "text/javascript");
webEngine.loadContent(jqueryStr, "text/javascript");
webEngine.loadContent(dataStr, "text/javascript");
webEngine.loadContent(webStr, "text/html");