Assignemnt #41 Using Swing For Input

Code

    ///Name: Morgan Kaplan
    ///Period: 5
    ///Project Name: UsingSwingForInput
    ///File Name: USFI.java
import javax.swing. *;

public class USFI
{
    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);
    }
}
    

Picture of Output

Assignment 41