Assignment 41, Using Swing For Input
Code
///Name: Stella Koliavas
///Period: 5
///Program Name: Using Swing
///File Name: UsingSwing.java
///Date Finshed: 11/02/15
import javax.swing.*;
public class UsingSwing
{
public static void main (String [] args)
{
String name = JOptionPane.showInputDialog(" What's 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);
}
}
Picture of the output