Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.JOptionPane;
- /**
- * Skeleton code for homework problem.
- */
- public final class EnhancedDialog
- {
- /**
- * Entry point for the application.
- * @param args not used
- */
- public static void main(String[] args)
- {
- int choice = JOptionPane.showConfirmDialog(null,
- "Would you like an A in CPE 305?", "choose one", JOptionPane.YES_NO_OPTION);
- // Interpret user's choice
- if (choice == JOptionPane.NO_OPTION)
- {
- System.out.println("A not desired.");
- }
- else
- {
- System.out.println("Desires an A.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement