Advertisement
niwdeyen

Ejemplo introducción JAVA

Feb 13th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.60 KB | None | 0 0
  1. //código del botón de ejemplo
  2.  
  3.         Date date = new Date();
  4.         this.lblresultado.setText(date.toString());
  5.         DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
  6.         JOptionPane.showMessageDialog(rootPane, "Hola " + this.txtNombre.getText()+ "\nHoy es: "+dateFormat.format(date));
  7.         int edad;
  8.         edad=Integer.parseInt(this.txtEdad.getText());
  9.  
  10.         if (edad>18){JOptionPane.showMessageDialog(rootPane,"Puede votar, elija sabiamente");}
  11.         else{JOptionPane.showMessageDialog(rootPane,"Espere a las proximas elecciones");}
  12.  
  13. //video: https://youtu.be/Wd4BpWhdMOg
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement