package com.redpois0n.gscrot.ui.components;

import java.awt.Desktop;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.net.URI;

import javax.swing.ImageIcon;
import javax.swing.JMenuItem;

@SuppressWarnings("serial")
public class URLMenuItem extends JMenuItem implements ActionListener {
	
	private String url;
	
	public URLMenuItem(String text, String url) {
		this(text, null, url);
	}
	
	public URLMenuItem(String text, ImageIcon icon, String url) {
		super(text, icon);
		setURL(url);
		addActionListener(this);
	}
	
	public void setURL(String url) {
		this.url = url;
		setEnabled(url != null);
	}
	
	public String getURL() {
		return this.url;
	}

	@Override
	public void actionPerformed(ActionEvent arg0) {
		try {
			Desktop.getDesktop().browse(new URI(url));
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

}

@@ -318,18 +318,17 @@
 tener %7B%0A
-%09
 %0A
+
 %09private
@@ -340,18 +340,17 @@
 ng url;%0A
-%09
 %0A
+
 %09public 
@@ -412,26 +412,25 @@
 l, url);%0A%09%7D%0A
-%09
 %0A
+
 %09public URLM
@@ -542,26 +542,25 @@
 r(this);%0A%09%7D%0A
-%09
 %0A
+
 %09public void
@@ -633,10 +633,9 @@
 %0A%09%7D%0A
-%09
 %0A
+
 %09pub
@@ -747,16 +747,54 @@
 %09%09try %7B%0A
+%09%09%09if (Desktop.isDesktopSupported())%0A%09
 %09%09%09Deskt

Update URLMenuItem.java