I need help with KeyEvent registered to a JTextField
I have a textfield which has the focus and has a KeyListener... The user can click any key on the keyboard... But some key's like the '=' key has a special function (a dialog will open)... How do I go about this having to open the dialog while the key is not explicitly placed in the JTextField (much like that of the Cancel key of Visual Basic where the key is not rendered to the field...)
is it enough to just do the following code?
ke.setKeyChar(KeyEvent.UNDEFINED_CHAR);
or
ke.setKeyCode(KeyEvent.VK_Cancel);
Please I need help