1/17
Flashcards focused on Java Swing Action, Key, and Item Events, including corresponding event classes, listener methods, and GUI components.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
ActionEvent Class
An event class generated when a button is clicked or an item of a list is double-clicked.
actionPerformed(ActionEvent e)
An ActionListener method invoked when an action occurs.
KeyEvent Class
An event class indicating a keystroke occurred, passed to registered KeyListener or KeyAdapter objects as a low-level event by a Swing component.
keyTyped(KeyEvent evt)
A KeyListener method generated when a Unicode character is entered, which does not depend on platform or keyboard layout.
ASCII
Character set represented by 28 combinations.
UNICODE
Character set represented by 216 combinations.
getKeyChar()
A method that returns a valid Unicode character reported by KEY_TYPED events.
getKeyCode()
A method that returns the event's keycode based on a specific keyboard layout for KEY_PRESSED and KEY_RELEASED events, returning VK_Undefined for key typed events.
getExtendedKeyCode()
A method used with many international keyboard layouts such as the smiley emoticon key.
Virtual key codes
Codes that report which keyboard key has been pressed rather than a specific character.
JCheckBox Class
A Swing component representing an item that can be selected or deselected to turn an option on or off.
JRadioButton Class
A Swing component used to let the user select one of a set of mutually exclusive options.
ButtonGroup
A helper class that groups radio buttons and manages the group's state so only one button in the group can be selected at a time.
JComboBox Class
A Swing component that combines a button or editable field and a drop-down list.
ItemEvent Class
An event passed to the ItemListener whenever the selected item in a list control (such as a list box or combo box) is changed.
getItem()
An ItemListener event handler method that returns the item that was selected or deselected.
getSource()
An ItemListener event handler method that returns the object on which the event occurred.
getStateChanged()
An ItemListener event handler method that returns either SELECTED or DESELECTED to indicate the state change.