public class SwitchErrorsGui
{
	public static void main(String[] args)
	{
		String input;

		JOptionPane.showMessageDialog(
			null, "Key: 1=blue, 2=red, 3=green");

		input = JOptionPane.showInputDialog(
			"Enter a number and I'll return the corresponding color");
		int number = Integer.parseInt(input)

		switch(number)
		{
			case 1:
				JOptionPane.showMessageDialog(
					null, "You choose red!");
				break;
			case 2:
				JOptionPane.showMessageDialog(
					null, "You choose blue!");
				break;
			case 3:
				JOptionPane.showMessageDialog(
					null, "You choose green!");
			default:
				JOptionPane.showMessageDialog(
					null, "Color not available!");
				break;
		}
		System.exit(0);
	}
}