import javax.swing.JOptionPane; public class Switch { public static void main(String[] args) { String input = JOptionPane.showInputDialog("Please input a digit: "); int digit = Integer.parseInt(input); switch (digit) { case 1: System.out.println("one"); break; case 2: System.out.println("two"); break; case 3: System.out.println("three"); break; default: if(digit>0) System.out.println("Greater than 3");break; } } }