title: error: incompatible types: String cannot be converted to URI
body: <p>Im building a calculator with a hyperlink on a JButton to a website but im getting the error: incompatible types: String cannot be converted to URI.</p>
  
  <p>the error is in the line:</p>
  
  <pre><code>if(e.getSource()==LOGO
  java.awt.Desktop.getDesktop().browse("Example.com");
  </code></pre>
  
  <p>What does the error mean? and how can i solve it?</p>
  
  <pre><code>/**
   Case : Computer Science Corporation
   */
  import javax.swing.*;
  
  import java.awt.*;
  import java.awt.Desktop;
  import java.awt.event.ActionEvent;
  import java.awt.event.ActionListener;
  
  public class CSC extends JFrame {
      // frame settings//
      public static void main(String args[] ) {
          JFrame frame = new CSC();
          frame.setSize(500, 500);
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.setTitle("Rekenmachine");
          JPanel Paneel = new Paneel();
          frame.setContentPane( new Paneel() );
          frame.setVisible(true);
      }
  }
  //paneel opbouw//
  class Paneel extends JPanel implements ActionListener{
      public JButton Een,Twee,Drie,Vier,Vijf,Zes,Zeven,Acht,Negen,Nul,C,Min,Plus,Deel,Vermenigvuldig,Totaal,LOGO;
      public JTextField Output;
      static double a=0,b=0,result=0;
      static int operator=0;
  
      public Paneel(){
          setLayout (null);
  
          Een = new JButton("1");
          Een.setBounds(20, 225, 50, 50);
          Een.addActionListener(this);
  
          Twee = new JButton("2");
          Twee.setBounds(80, 225, 50, 50);
          Twee.addActionListener(this);
  
          Drie = new JButton("3");
          Drie.setBounds(140, 225, 50, 50);
          Drie.addActionListener(this);
  
          Vier = new JButton("4");
          Vier.setBounds(20, 165, 50, 50);
          Vier.addActionListener(this);
  
          Vijf = new JButton("5");
          Vijf.setBounds(80, 165, 50, 50);
          Vijf.addActionListener(this);
  
          Zes = new JButton("6");
          Zes.setBounds(140, 165, 50, 50);
          Zes.addActionListener(this);
  
          Zeven = new JButton("7");
          Zeven.setBounds(20, 105, 50, 50);
          Zeven.addActionListener(this);
  
          Acht = new JButton("8");
          Acht.setBounds(80, 105, 50, 50);
          Acht.addActionListener(this);
  
          Negen = new JButton("9");
          Negen.setBounds(140, 105, 50, 50);
          Negen.addActionListener(this);
  
          Nul = new JButton("0");
          Nul.setBounds(20, 285, 50, 50);
          Nul.addActionListener(this);
  
          C = new JButton("C");
          C.setBounds(80, 285, 50, 50);
          C.addActionListener(this);
  
          Min = new JButton("-");
          Min.setBounds(200, 285, 50, 50);
          Min.addActionListener(this);
  
          Plus = new JButton("+");
          Plus.setBounds(200, 225, 50, 50);
          Plus.addActionListener(this);
  
          Deel = new JButton("/");
          Deel.setBounds(200, 105, 50, 50);
          Deel.addActionListener(this);
  
          Vermenigvuldig = new JButton("*");
          Vermenigvuldig.setBounds(200, 165, 50, 50);
          Vermenigvuldig.addActionListener(this);
  
          Totaal = new JButton("=");
          Totaal.setBounds(140, 285, 50, 50);
          Totaal.addActionListener (this);
  
          Output = new JTextField("");
          Output.setBounds(20, 20, 230, 75);
          Output.setEditable(false);
          Output.setHorizontalAlignment(SwingConstants.RIGHT);
  
          LOGO = new JButton ("LOGO");
          LOGO.setBounds (20,345,230,75);
          LOGO.addActionListener (this);
  
  
  
          add (Een);
          add (Twee);
          add (Drie);
          add (Vier);
          add (Vijf);
          add (Zes);
          add (Zeven);
          add (Acht);
          add (Negen);
          add (Nul);
          add (C);
          add (Min);
          add (Plus);
          add (Vermenigvuldig);
          add (Totaal);
          add (Deel);
          add (Output);
          add (LOGO);
      }
  
       public void actionPerformed(ActionEvent e)
      {
  
          if(e.getSource()==LOGO)
              java.awt.Desktop.getDesktop().browse("example.com");
  
          if(e.getSource()==Een)
              Output.setText(Output.getText().concat("1"));
  
          if(e.getSource()==Twee)
              Output.setText(Output.getText().concat("2"));
  
          if(e.getSource()==Drie)
              Output.setText(Output.getText().concat("3"));
  
          if(e.getSource()==Vier)
              Output.setText(Output.getText().concat("4"));
  
          if(e.getSource()==Vijf)
              Output.setText(Output.getText().concat("5"));
  
          if(e.getSource()==Zes)
              Output.setText(Output.getText().concat("6"));
  
          if(e.getSource()==Zeven)
              Output.setText(Output.getText().concat("7"));
  
          if(e.getSource()==Acht)
              Output.setText(Output.getText().concat("8"));
  
          if(e.getSource()==Negen)
              Output.setText(Output.getText().concat("9"));
  
          if(e.getSource()==Nul)
              Output.setText(Output.getText().concat("0"));
  
          if(e.getSource()==Plus)
          {
              a=Double.parseDouble(Output.getText());
              operator=1;
              Output.setText("");
          } 
  
          if(e.getSource()==Min)
          {
              a=Double.parseDouble(Output.getText());
              operator=2;
              Output.setText("");
          }
  
          if(e.getSource()==Vermenigvuldig)
          {
              a=Double.parseDouble(Output.getText());
              operator=3;
              Output.setText("");
          }
  
          if(e.getSource()==Deel)
          {
              a=Double.parseDouble(Output.getText());
              operator=4;
              Output.setText("");
          }
  
          if(e.getSource()==Totaal)
          {
              b=Double.parseDouble(Output.getText());
  
              switch(operator)
              {
                  case 1: result=a+b;
                      break;
  
                  case 2: result=a-b;
                      break;
  
                  case 3: result=a*b;
                      break;
  
                  case 4: result=a/b;
                      break;
  
                  default: result=0;
              }
  
              Output.setText(""+result);
          }
  
          if(e.getSource()==C)
              Output.setText("");
  
      }
  }
  </code></pre>
  
  <p>Update:</p>
  
  <p>2 new errors have come up:
  error: unreported exception URISyntaxException; must be caught or declared to be thrown
  error: unreported exception IOException; must be caught or declared to be thrown</p>
  
  <pre><code>/**
   Case : Computer Science Corporation
   */
  import javax.swing.*;
  
  import java.awt.*;
  import java.awt.Desktop;
  import java.awt.event.ActionEvent;
  import java.awt.event.ActionListener;
  
  import java.net.URI;
  import java.net.URISyntaxException;
  
  import java.io.IOException;
  
  
  public class CSC extends JFrame {
      // frame settings//
      public static void main(String args[] ) {
          JFrame frame = new CSC();
          frame.setSize(500, 500);
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.setTitle("Rekenmachine");
          JPanel Paneel = new Paneel();
          frame.setContentPane( new Paneel() );
          frame.setVisible(true);
      }
  }
  //paneel opbouw//
  class Paneel extends JPanel implements ActionListener{
      public JButton Een,Twee,Drie,Vier,Vijf,Zes,Zeven,Acht,Negen,Nul,C,Min,Plus,Deel,Vermenigvuldig,Totaal,LOGO;
      public JTextField Output;
      static double a=0,b=0,result=0;
      static int operator=0;
  
      public Paneel(){
          setLayout (null);
  
          Een = new JButton("1");
          Een.setBounds(20, 225, 50, 50);
          Een.addActionListener(this);
  
          Twee = new JButton("2");
          Twee.setBounds(80, 225, 50, 50);
          Twee.addActionListener(this);
  
          Drie = new JButton("3");
          Drie.setBounds(140, 225, 50, 50);
          Drie.addActionListener(this);
  
          Vier = new JButton("4");
          Vier.setBounds(20, 165, 50, 50);
          Vier.addActionListener(this);
  
          Vijf = new JButton("5");
          Vijf.setBounds(80, 165, 50, 50);
          Vijf.addActionListener(this);
  
          Zes = new JButton("6");
          Zes.setBounds(140, 165, 50, 50);
          Zes.addActionListener(this);
  
          Zeven = new JButton("7");
          Zeven.setBounds(20, 105, 50, 50);
          Zeven.addActionListener(this);
  
          Acht = new JButton("8");
          Acht.setBounds(80, 105, 50, 50);
          Acht.addActionListener(this);
  
          Negen = new JButton("9");
          Negen.setBounds(140, 105, 50, 50);
          Negen.addActionListener(this);
  
          Nul = new JButton("0");
          Nul.setBounds(20, 285, 50, 50);
          Nul.addActionListener(this);
  
          C = new JButton("C");
          C.setBounds(80, 285, 50, 50);
          C.addActionListener(this);
  
          Min = new JButton("-");
          Min.setBounds(200, 285, 50, 50);
          Min.addActionListener(this);
  
          Plus = new JButton("+");
          Plus.setBounds(200, 225, 50, 50);
          Plus.addActionListener(this);
  
          Deel = new JButton("/");
          Deel.setBounds(200, 105, 50, 50);
          Deel.addActionListener(this);
  
          Vermenigvuldig = new JButton("*");
          Vermenigvuldig.setBounds(200, 165, 50, 50);
          Vermenigvuldig.addActionListener(this);
  
          Totaal = new JButton("=");
          Totaal.setBounds(140, 285, 50, 50);
          Totaal.addActionListener (this);
  
          Output = new JTextField("");
          Output.setBounds(20, 20, 230, 75);
          Output.setEditable(false);
          Output.setHorizontalAlignment(SwingConstants.RIGHT);
  
          LOGO = new JButton ("LOGO");
          LOGO.setBounds (20,345,230,75);
          LOGO.addActionListener (this);
  
  
  
          add (Een);
          add (Twee);
          add (Drie);
          add (Vier);
          add (Vijf);
          add (Zes);
          add (Zeven);
          add (Acht);
          add (Negen);
          add (Nul);
          add (C);
          add (Min);
          add (Plus);
          add (Vermenigvuldig);
          add (Totaal);
          add (Deel);
          add (Output);
          add (LOGO);
      }
  
       public void actionPerformed(ActionEvent e)
      {
  
          if(e.getSource()==LOGO)
          java.awt.Desktop.getDesktop().browse(new java.net.URI("http://www.google.com"));
  
          if(e.getSource()==Een)
              Output.setText(Output.getText().concat("1"));
  
          if(e.getSource()==Twee)
              Output.setText(Output.getText().concat("2"));
  
          if(e.getSource()==Drie)
              Output.setText(Output.getText().concat("3"));
  
          if(e.getSource()==Vier)
              Output.setText(Output.getText().concat("4"));
  
          if(e.getSource()==Vijf)
              Output.setText(Output.getText().concat("5"));
  
          if(e.getSource()==Zes)
              Output.setText(Output.getText().concat("6"));
  
          if(e.getSource()==Zeven)
              Output.setText(Output.getText().concat("7"));
  
          if(e.getSource()==Acht)
              Output.setText(Output.getText().concat("8"));
  
          if(e.getSource()==Negen)
              Output.setText(Output.getText().concat("9"));
  
          if(e.getSource()==Nul)
              Output.setText(Output.getText().concat("0"));
  
          if(e.getSource()==Plus)
          {
              a=Double.parseDouble(Output.getText());
              operator=1;
              Output.setText("");
          } 
  
          if(e.getSource()==Min)
          {
              a=Double.parseDouble(Output.getText());
              operator=2;
              Output.setText("");
          }
  
          if(e.getSource()==Vermenigvuldig)
          {
              a=Double.parseDouble(Output.getText());
              operator=3;
              Output.setText("");
          }
  
          if(e.getSource()==Deel)
          {
              a=Double.parseDouble(Output.getText());
              operator=4;
              Output.setText("");
          }
  
          if(e.getSource()==Totaal)
          {
              b=Double.parseDouble(Output.getText());
  
              switch(operator)
              {
                  case 1: result=a+b;
                      break;
  
                  case 2: result=a-b;
                      break;
  
                  case 3: result=a*b;
                      break;
  
                  case 4: result=a/b;
                      break;
  
                  default: result=0;
              }
  
              Output.setText(""+result);
          }
  
          if(e.getSource()==C)
              Output.setText("");
  
      }
  }   
  </code></pre>