import javax.swing.JOptionPane; public class EvenOddTwo { public static void main(String[] args) { String nameStr = JOptionPane.showInputDialog(null, "Enter Value"); if (Integer.parseInt(nameStr) % 2 == 0) { JOptionPane.showMessageDialog(null, "Even value"); } else { JOptionPane.showMessageDialog(null, "Odd value"); } } }