I made a method to input numbers. But I want that input is numeric but a dot (.) Can still be entered. please my friend help me. Thanks
private void jTextField1KeyTyped(java.awt.event.KeyEvent evt) {
// TODO add your handling code here:
FilterHanyaAngka(evt);
}
public void FilterHanyaAngka(java.awt.event.KeyEvent evt) {
char c = evt.getKeyChar();
if (!((Character.isDigit(c) || (c == KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE)))) {
evt.consume();
}
}