12.6 Q1: Which of the following does not generate GUI events?
a. Typing in a text field.
b. Selecting an item from a menu.
c. Viewing the text in a label.
d. Moving the mouse.
12.6 Q2: Which of the following is false?
a. A JPasswordField shows that characters are being entered, but hides the actual
character with an echo character.
b. Class JTextField extends JTextComponent; Class JPasswordField extends
JTextField.
c. Both JTextFields and JPasswordFields are single-line areas in which the user can
enter text via the keyboard.
d. JPasswordFields generate events; JTextFields do not.
12.6 Q3: Which of the following statements makes the text in a JTextField uneditable?
a. textField.setEditable(true);
b. textField.setEditable(false);
c. textField.setUneditable(true);
d. textField.setUneditable(false);
12.6 Q4: Which of the following most completely describes the steps for setting up event
handling for a GUI component?
a. Create a class that represents the event handler, attach the JFrame to a JWindow object
and register the event handler.
b. Implement an appropriate event-listener interface and register the event handler.
c. Create a class that represents the event handler and implement an appropriate event-
listener interface.
d. Create a class that represents the event handler, implement an appropriate event–
listener interface and register the event handler.
12.6 Q5: Which of the following answers does not complete the sentence correctly?
An anonymous inner class .
a. is frequently used for GUI event handling
b. is non–static
c. does not need a handle to its outer class to access its methods and variables
d. cannot be declared private
12.6 Q6: When the user presses Enter in a JPasswordField, the GUI component