Java Reference
In-Depth Information
1 . In general, AWT components are heavyweight and Swing components are light-
weight .
2 . Can the look and feel of a Swing component be changed? If so, what feature enables
this?
Yes. Swing's pluggable look and feel is the feature that enables this.
3 . What is the most commonly used top-level container for an application?
JFrame
4 . Top-level containers have several panes. To what pane are components added?
Content pane
5 . Show how to construct a label that contains the message "Select an entry from the
list".
6 . All interaction with GUI components must take place on what thread?
event-dispatching thread
7 . What is the default action command associated with a JButton ? How can the action
command be changed?
The default action command string is the text shown inside the button. It can be
changed by calling setActionCommand( ) .
8 . What event is generated when a push button is pressed?
ActionEvent
9 . Show how to create a text field that has 32 columns.
10 . Can a JTextField have its action command set? If so, how?
Yes, by calling setActionCommand( ) .
11 . What Swing component creates a check box? What event is generated when a check
box is selected or deselected?
JCheckBox creates a check box. An ItemEvent is generated when a check box is se-
lected or deselected.
12 . JList displays a list of items from which the user can select. True or False?
Search WWH ::




Custom Search