Search This Blog

Java: Open a url with default web browser

Open a web page with default web browser (from Java code):
try {
    java.awt.Desktop.getDesktop().browse(new URI("http://notepad2.blogspot.com.au/"));
} catch (Throwable e) {
    e.printStackTrace();
}

No comments:

Post a Comment