Question: I am trying to get a java gui to open a web page. So the gui runs some code that does things and then produces a html file.
I then want this file to open in a web browser (preferrably Firefox) as soon as it is created. 
How would I go about doing that?

Answer: 
Ya, But if you want to open the webpage in your default web browser by a java program then you can try using this code.

```
/// file OpenPageInDefaultBrowser.java
public class OpenPageInDefaultBrowser {
   public static void main(String[] args) {
       try {
         //Set your page url in this string. For eg, I m using URL for Google Search engine
         String url = "http://www.google.com";
         java.awt.Desktop.getDesktop().browse(java.net.URI.create(url));
       }
       catch (java.io.IOException e) {
           System.out.println(e.getMessage());
       }
   }
}
/// End of file

```
I've used [BrowserLauncher2](http://browserlaunch2.sourceforge.net/) with success. It'll invoke the default browser on all platforms tested. I use this for demoing software via JNLP. The software downloads, runs and drives the user's browser to information pages/feedback etc.

JDK 1.4 and above, I believe.