// SumTwoSwing.java: sum two arguments input in windows import javax.swing.JOptionPane; class SumTwoSwing { public static void main(String[] args) { int x = Integer.parseInt( JOptionPane.showInputDialog("Enter first number:")); int y = Integer.parseInt( JOptionPane.showInputDialog("Enter second number:")); JOptionPane.showMessageDialog( null, "The sum is " + (x+y), "Result of sum", JOptionPane.PLAIN_MESSAGE); System.exit(0); } }