title: Java malformed url exception for simple url
body: <p>Frustrating malformed url exception.  As a test, i added the "<strong>URL url = new URL("<a href="http://www.google.com" rel="nofollow noreferrer">http://www.google.com</a>");</strong>" just to see if a very simple url would throw an error, and it does. I am lost as to what is causing this.</p>
  
  <pre><code>import javax.swing.*;
  import java.net.*;
  
  public class Train {
  
  public static void main(String[] args) {
      URL url = new URL("http://www.google.com");
      ImageIcon icon = new ImageIcon(new URL("https://upload.wikimedia.org/wikipedia/commons/d/d4/Wikipedesketch1.png"));**
      Integer miles = Integer.parseInt(JOptionPane.showInputDialog("Enter the miles"));
      Double gallons = Double.parseDouble(JOptionPane.showInputDialog("Enter the gallons"));  
      Double mpg = miles / gallons;
      JOptionPane.showMessageDialog(null, "Miles per gallon is " + mpg, "Gass Mileage", JOptionPane.PLAIN_MESSAGE, icon); 
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Exception in thread "main" java.lang.Error: Unresolved compilation problems: 
      Unhandled exception type MalformedURLException
      Unhandled exception type MalformedURLException</p>
  
  <pre><code>at Train.main(Train.java:13)
  </code></pre>