import javax.swing.JOptionPane;
public class Errors
{

public static int x=0;
public static String userInput="";
public static void main(String args [] )
  {
  userInput = JOptionPane.showInputDialog("Enter a number: ");
try {
  x = Integer.parseInt( userInput );
  }
catch (Exception e )  
  {
  System.out.println("You idiot!");
  x = 10;
  e.printStackTrace( ); // where the error was

  System.out.println("user did " + e.getMessage( ) ); 
                                    // what input caused error
   
  System.out.println("computer thought " + e.toString( ) );
                                    // the computer’s description of 
                                    // the message
  
  } // end catch
  
  System.out.println( x );

  } // end main 
} // end class
