import javax.swing.*;
public class JOptionPaneShowInputDialogExample
{
public static void main(String[] args)
{
JFrame frame = new JFrame("InputDialog Example");
// prompt the user to enter their name
String name = JOptionPane.showInputDialog(frame, "What's your name?");
// get the user's input. note that if they press Cancel, 'name' will be null
System.out.println("The user's name is "+ name);
System.exit(0);
}
}
Tuesday, 23 January 2018
Related Posts:
Do While in java import javax.swing.JOptionPane;public class DoTest // start attr… Read More
Foreach example 2 in java import java.util.*; public class ForEachExample1 { p… Read More
Sentinel in java import javax.swing.JOptionPane;public class Sentinel{ … Read More
Diamond .java public class Diamond{ public static void main(String[] args)&nbs… Read More
0 comments: