Platinum Partner

JLabel Link: Open Browser Form Swing GUI By Clicking On Link

// Opens a browser on a specific site when clicking on the JLabel



                link = new JLabel(" Click here to find the PUID          \n");
		link.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
		link.addMouseListener(new MouseAdapter() {
		   public void mouseClicked(MouseEvent e) {
		      if (e.getClickCount() > 0) {
		    	  if (Desktop.isDesktopSupported()) {
		                Desktop desktop = Desktop.getDesktop();
		                try {
		                		URI uri = new URI("http://www.nationalarchives.gov.uk/PRONOM/Format/proFormatSearch.aspx?status=new");
		                        desktop.browse(uri);
		                } catch (IOException ex) {
		                        // do nothing
		                } catch (URISyntaxException ex) {
							//do nothing
						}
		        } else {
		               //do nothing
		        }

		      }
		   }
		});
{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}