Advertisement
joerex101

joptionpane demo

Nov 6th, 2012
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.61 KB | None | 0 0
  1. /**
  2.  *
  3.  * @author Joerex
  4.  */
  5. import javax.swing.JOptionPane;
  6.  
  7. public class JOptionDemo
  8. {
  9.  public static void main(String[] args)
  10.  {
  11.    String fullName = "";
  12.    String strAge = "";
  13.    
  14.    int age = 0;
  15.    
  16.    fullName=JOptionPane.showInputDialog(null, "Enter your full name:");
  17.    JOptionPane.showMessageDialog(null,"Your full name is "+fullName);
  18.    strAge=JOptionPane.showInputDialog(null,"Enter your age:");
  19. age=Integer.parseInt(strAge);
  20.    JOptionPane.showConfirmDialog(null,age,"Is this your real age?",JOptionPane.OK_CANCEL_OPTIONS);
  21.    JOptionPane.showMessageDialog(null, "Your age is"+age+".");
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement