I am writing a Java program that creates HTML code.
What’s the best/easiest possibility to have a preview of the code?
- Show the code in the
JFrame: How can I do this? - Open the windows browser with the created File? Is this possible?
- A totally different approach?
Both are quite easy to do. Here is a page from the Java tutorial that shows how to display HTML in Swing (you’d use a
file:URL to display the contents of a file.) You can display a URL in an external browser using Java 6’sDesktopclass:Alternately, save the data in a file with the
*.htmlextension and use