how would I load local files relative to the current java file in JWebbrowser?
I know that I could load my page with navigate("path");
the problem is how to set relative path!
for example my java code is in : D:\Eclipse_Project\MyProject\src\javaCode\browser.java and the html file is in : D:\Eclipse_Project\MyProject\src\pages\html.html
but I don't want to use as follow:
webBrowser.navigate("file:///D:/Eclipse_Project/MyProject/src/pages/html.html");
Edit:
my html file also contains CSS an javaScript.
Please try the following code:
1. Read html content with scanner.
2. Set html string to webBrowser.