Skip to content

Instantly share code, notes, and snippets.

Avatar

Kota Jayadev Senapathi JayadevSenapathi

View GitHub Profile
@JayadevSenapathi
JayadevSenapathi / GUIInput.java
Created Sep 11, 2017
A sample Java program using GUI with javax.swing package.
View GUIInput.java
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");
}
}