Perl programmer for hire: download my resume (PDF).
John Bokma MexIT
freelance Perl programmer

Comments: How to open a URL in the default browser

3 comments

If you ever wondered if there is an easy way to open a URL from your Java program in the user-default browser, with Java SE 6 there is. Unless your platform doesn't support this. The good news is that you can test if this is the case or not.

Read the rest of How to open a URL in the default browser.

Comments

Yes, it's quite easy in java 1.6 But how about java 1.5? I've found just this one:

AppletContext a = getAppletContext();
URL url = new URL(link);
a.showDocument(url,"_blank");

Unfortunately it's not for desktop applications.

Posted by Alexander at 16:21 GMT on 15 July 2009

Thanks for this code. It works great in my program. THank you thank you!!!

Posted by nan at 21:59 GMT on 23 February 2010

how to create a open button to execute the openuri project

Posted by Anonymous at 06:00 GMT on 28 January 2011

Post a comment

Note that your comment doesn't show up immediately. I review each comment before I add it to this site.

Check the Follow this page option if you want to receive an email each time a comment is posted to this page, including yours. A link to turn this option off will be included with each email.

Internet adresses will be converted automatically. You can use the following notation to specify anchor text for a link: [url=http://example.com/]example text[/url].