Created
December 9, 2015 04:17
-
-
Save nosdoska/fee40171a2c3c227aa47 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public JOptionPane validarLetra(java.awt.event.KeyEvent evt) { | |
char c = evt.getKeyChar(); | |
if (Character.isDigit(c)) { | |
getToolkit().beep(); | |
evt.consume(); | |
JOptionPane.showMessageDialog(rootPane, "Digite sólo letras."); | |
} | |
return null; | |
} | |
public JOptionPane validarNumero(java.awt.event.KeyEvent evt) { | |
char c = evt.getKeyChar(); | |
if (Character.isLetter(c)) { | |
getToolkit().beep(); | |
evt.consume(); | |
JOptionPane.showMessageDialog(rootPane, "Digite sólo números."); | |
} | |
return null; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment