Swing Theory
Layout Managers
Swing Methods
Miscellaneous
100
A top-level window with a title and a border
What is a JFrame?
100
Gives five zones to place components.
What is BorderLayout?
100
I want my JFrame to actually show on screen.
What is setVisible(true);?
100
Adds the ability to have something happen over time, without blocking the UI.
What is Timer?
200
The older set of components on which Swing was built.
What is AWT?
200
A JPanel comes with this layout manager.
What is FlowLayout?
200
Method called to reduce window size to contained components' preferred size.
What is pack()
200
The container needed to hold an ImageIcon.
What can a JLabel be used for?
300
The container that opens as a pop-up, much like a javascript 'alert.'
What is JDialog?
300
How many rows should I specify if I want an unlimited number of rows in a GridLayout?
0.
300
I want to know the origin of a generated ActionEvent e.
What is e.getActionCommand() or e.getSource()?
300
Makes a JDialog the only window that can be interacted with.
What does setModal() do?
400
Implemented to assign actions to to a JButton
What is ActionListener?
400
If I want two components to equally share horizontal space upon resize when using a GridBagLayout, what should I set?
If c, d are some components: c.weightx=0.5; d.weightx=0.5;
400
I want to get the JFrame from any JPanel, irrespective of the depth of the JPanel.
What is (JFrame) SwingUtilities.getWindowAncestor(this);
400
What do I need to have in order to populate a JComboBox with options?
An array, Vector or existing ComboBoxModel.
500
The four containment hierarchies (layers) available in Swing.
What are the root, layered, content and glass panes?
500
How do I add a CardLayout to my JFrame?
You can't! First, create a JPanel as a content container, then assign that a CardLayout.
500
If called on a MouseEvent, what do getX() and getY() return?
The cursor position, relative to the source component.
500
Needed to render a component not handled by default as a JList item.
What is a ListCellRenderer?
M
e
n
u