I need a JTextField
can only accept values of both negative and positive numbers but I can not get the '-'. I've already tried several things.
private void JTPtxKeyTyped(java.awt.event.KeyEvent evt) {
char a = evt.getKeyChar();
if ((a<'0' || a>'9' || /*FALTA LA INSTRUCCION PARA ACEPTAR EL MENOS*/)) evt.consume();
}