import javax.swing.JOptionPane; public class Program { public static void main(String[] args) { String temp = JOptionPane.showInputDialog("Enter a number: "); int number = Integer.parseInt(temp); JOptionPane.showMessageDialog(null, "The number " + number + " is " + (number%2==0 ? "even":"odd")); } }