My Java Swing application generates an HTML file, and I want to open it with the default browser when it is generated and saved. How can I do this?
If you're not using Java 6 (or not sure your users will) - you can use Bare Bones Browser Launcher to launch the default browser. It uses Java 6 Desktop.open() if available, and falls back to platform specific approaches if it's not.
You can try this:
Runtime.getRuntime().exec("hh.exe index.chm");
Check this page, this can give you a much more detailed usage of the Desktop API.
If you are using Java 6, use Desktop.open(). It allows you to open any file with the default application associated with its file type on the system.