Assignment #41 Using Swing for Input
Code
///Name: Ian Grant
///Period:5
///Project Name: Using Swing for Input
///File Name:Swing.java
///10/23/15
import javax.swing.*;
public class Swing
{
public static void main(String[] args)
{
String name = JOptionPane.showInputDialog("What is your name?");
String input = JOptionPane.showInputDialog("How old are you?");
int age = Integer.parseInt(input);
System.out.print("Hello, "+name+". ");
System.out.println("Next year, you'll be "+(age+1));
System.exit(0);
}
}
Output