This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.swing.*; | |
public class GUIInput { | |
public static void main(String[] args) { | |
String name = JOptionPane.showInputDialog("What's your name?"); | |
String ageString = JOptionPane.showInputDialog("What's your age?"); | |
int age = Integer.valueOf(ageString); | |
System.out.print("Hello " + name); | |
System.out.println("You are going to be " + (age + 1) + " next year"); | |
} | |
} |