Is there a way to validate the data in the JTextField. I only want the user to input numeric values. But i want to be able to trap the key as soon as the key is released. If it is numeric, then it is displayed on the screen. otherwise, whatever is typed is not displayed on the screen anymore. TIA
add a TextListener for the textField. then override the method textValueChanged(TextEvent e). check for the value that changed. if it is a number continue, otherwise use the consume method to do nothing. hope it helps.