Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package lessons;
- import javax.swing.JOptionPane;
- public class DialogBoxes
- {
- public static void main(String[] args)
- {
- JOptionPane.showMessageDialog(null, "hello world");
- // null sets to center
- // whatever is enters into the dialog box is ALWAYS saved as a string literal
- String name;
- name = JOptionPane.showInputDialog("enter your name");
- JOptionPane.showMessageDialog(null, name);
- System.exit(0);
- // whenever you are done with a thread of boxes close the system with this
- }
- }
Add Comment
Please, Sign In to add comment