/** * A simple intelligence test */ import javax.swing.*; public class SimpleTest { public static void main( String[ ] args ) { String choice = JOptionPane.showInputDialog( "What is the world's greatest university? (hint: UMCP)" ); if (choice.equals("UMCP")) // correct response JOptionPane.showMessageDialog(null, "Wise choice."); else // incorrect response JOptionPane.showMessageDialog(null, "Sorry, you blew it."); System.exit(0); // terminate program } }