[jetrix-cvs] SF.net SVN: jetrix:[861] jetrix/trunk/src/java/net/jetrix/SystrayManager. java
Brought to you by:
smanux
From: <sm...@us...> - 2010-08-17 10:31:37
|
Revision: 861 http://jetrix.svn.sourceforge.net/jetrix/?rev=861&view=rev Author: smanux Date: 2010-08-17 10:31:31 +0000 (Tue, 17 Aug 2010) Log Message: ----------- Minor simplification in the way the browser is opened from the system tray Modified Paths: -------------- jetrix/trunk/src/java/net/jetrix/SystrayManager.java Modified: jetrix/trunk/src/java/net/jetrix/SystrayManager.java =================================================================== --- jetrix/trunk/src/java/net/jetrix/SystrayManager.java 2010-05-06 11:21:05 UTC (rev 860) +++ jetrix/trunk/src/java/net/jetrix/SystrayManager.java 2010-08-17 10:31:31 UTC (rev 861) @@ -22,7 +22,7 @@ import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.io.IOException; +import java.net.*; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.*; @@ -80,7 +80,7 @@ itemLink.addActionListener(new OpenURLActionListener("http://jetrix.sourceforge.net")); MenuItem itemSupport = new MenuItem("Technical Support"); - itemSupport.addActionListener(new OpenURLActionListener("http://sourceforge.net/forum/forum.php?forum_id=172941")); + itemSupport.addActionListener(new OpenURLActionListener("http://sourceforge.net/projects/jetrix/forums/forum/172941")); MenuItem itemExit = new MenuItem("Stop & Exit"); itemExit.addActionListener(new ActionListener() @@ -186,24 +186,11 @@ { try { - // open the browser - String osname = System.getProperty("os.name"); - if (osname.contains("Linux")) - { - Runtime.getRuntime().exec("firefox " + url); - } - else if (osname.contains("Windows")) - { - Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url); - } - else if (osname.contains("Mac")) - { - Runtime.getRuntime().exec("open " + url); - } + Desktop.getDesktop().browse(new URI(url)); } - catch (IOException e) + catch (Exception e) { - log.log(Level.WARNING, e.getMessage(), e); + log.log(Level.WARNING, "Unable to open the url: " + url, e); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |