If you want to prevent the character represented by a KeyEvent from being added to a TextField, what should you do ing the keyTyped method of a listener getting the event?
a. Execute the KeyEvent object's consume method.
b. Return true from the keyTyped method.
c. Call the KeyEvent object's setKeyChar method with a zero value.
d. Get the current text from the TextField, remove the last character from the String.
The answer is A. Could anyone explain why?