Posted By: Xarthor
[solved][Java] Displaying a local html file - 05/28/10 14:00
Good day!
I got a "fast" question about a problem I'm currently unable to solve:
I'd like to display a html file in a Java application.
Displaying a html file from an url (such as http://www.google.com) works, but my html file is a local one.
Its locate in the project's subfolder "Manual".
Which "url" do I pass to the JEditorPane's setPage method to display the index.html file (Manual/index.html) ?
Any help is appreciated!
Thanks in advance!
edit:
Solution: (Thanks to damocles!)
I got a "fast" question about a problem I'm currently unable to solve:
I'd like to display a html file in a Java application.
Displaying a html file from an url (such as http://www.google.com) works, but my html file is a local one.
Its locate in the project's subfolder "Manual".
Which "url" do I pass to the JEditorPane's setPage method to display the index.html file (Manual/index.html) ?
Any help is appreciated!
Thanks in advance!
edit:
Solution: (Thanks to damocles!)
Code:
String manualFile = "file://"; java.io.File currentDir = new java.io.File("Manual/index.html"); manualFile += currentDir.getAbsolutePath();