Assignment #41 Using Swing for input
Code
/// Name: DeeJay Cerezo
/// Period: 7
/// Program Name: Using Swing for input
/// File Name: Prog611.java
/// Date Finished: 11/10/2015
import javax.swing.*;
public class Prog611
{
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.println( "Hello," + name + "." );
System.out.println( "Next year, you'll be " + (age+1) );
System.exit(0);
}
}
Picture of the output