While I can certainly show the contents of a web page in a JEditorPane, how do I launch the desktop's browser with the new URL?
Created Jul 31, 2005
John Zukowski The JDesktop Integration Components (JDIC), available from https://jdic.dev.java.net, offers support for this:
import java.net.*;
import org.jdesktop.jdic.desktop.*;
public class LaunchURL {
public static void main(String[] args) {
try {
Desktop.browse(new URL("http://www.jguru.com/"));
} catch (MalformedURLException e){
System.err.println("not today");
e.printStackTrace();
} catch (DesktopException e){
e.printStackTrace();
}
}
}