title: Adding and Opening links on a JButton
body: <p>I am coding a simple JFrame/Application that opens an applet with some simple buttons on them.
  I would just like those buttons to open certain webpages/links on click.</p>
  
  <p>Code:</p>
  
  <pre><code>package me.jamplifier;
  
  import java.awt.Desktop;
  import java.awt.GridBagLayout;
  import java.awt.event.ActionEvent;
  import java.awt.event.ActionListener;
  import java.io.IOException;
  import java.net.URI;
  import java.net.URISyntaxException;
  
  import javax.swing.*;
  
  public class Launcher extends JFrame
  {
      public Launcher()
      {
          JFrame frame = new JFrame("Hurricane Craft");
          frame.setVisible(true);
          frame.setSize(200, 200);
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  
          JLabel label = new JLabel("Welcome to Hurricane Craft");
          JPanel panel = new JPanel();
          frame.add(panel);
          panel.add(label);
  
          JButton site = new JButton("Site");
          JButton forums = new JButton("Forums");
          panel.add(site);
          panel.add(forums);
      }
  
      public static void main(String[] args)
      {
          new Launcher();
      }
  }
  </code></pre>