package class3_3_SwitchStatement_start; // Josiah Yoder, MSOE, 24 September 2015 import javax.swing.*; public class SwitchStatement { public static void main(String[] args) { String input = JOptionPane.showInputDialog(null, "What do you want? Enter a digit from the options below.\n" + "1: Apples\n" + "2: Oranges"); int choice = Integer.parseInt(input); if(choice == 1) { JOptionPane.showMessageDialog(null, "Apples"); } else if (choice == 2) { JOptionPane.showMessageDialog(null, "Bananas"); } else { JOptionPane.showMessageDialog(null, "You didn't choose apples or bananas"); } } }