java - How to get file resources of a JavaFX WebEngine -
java - How to get file resources of a JavaFX WebEngine -
i pretty new javafx , i'm using code (https://docs.oracle.com/javafx/2/swing/simpleswingbrowser.java.htm) implement simple web view javafx. i'm not able files (html, css, images, javascript files, cookies, , on) create web page.
how can access files, can work them?
you can load html
using next methods. js
, css
, other files linked in html loaded along it.
webengine.load(getclass().getresource("/location/to-your-file.html").toexternalform());
if have file in local drive, can use:
string url = new url("file:///" + ""/location/to-your-file.html").toexternalform(); webengine.load(url);
java javafx-2 javafx-webengine
Comments
Post a Comment