Chapter Questions
What is a frame? How do you create a frame with Swing?
How do you set a frame's size?
How do you display a frame on the screen?
What is a content pane?
What is the difference between a frame and a panel?
What is an event listener?
If you are writing an event listener class for a JButton component, what interface must the class implement? What method must the class have? When is this method execured?
How do you register an event listener with a JButton component?
How do you change the background color of a component? How do you change the color of text displayed by a label or a button?
How do you add a layout manager to a container?
Which layout manager divides a container into regions known as north, south, cast, west, and center?
Which layout manager arranges components in a row, from left to right, in the order they were added to the container?
Which layout manager arranges components in rows and columns?
How many components can you have at one time in a Bordertayout region? In a GridLayout cell?
How do you prevent the ardertayout manager from resizing a component that has been placed in its region?
How can you cause a content pane to be automatically sized to accommodate the components contained within it?
What is the default layout manager for a JFrane object's content pane? For a JPane1 object?
You want the user to be able to select only one item from a group of items, Which type of component would you use for the items, radio buttons or check boxes?
You want the user to be able to select any number of items from a group of items. Which type of component would you use for the items, radio buttons or check boxes?
What is the purpose of a ButtonGroup object?
Do you normally add radio buttons, check boxes, or both to a ButtonGroup object?
What type of event does a radio button generate when the user clicks on it?
What type of crent does a check box generate when the user clicks on it?
How do you determine in code whether a radio button is selected?
How do you determine in code whether a check box is selected?
What method do you use to set a border around a component?
What is the preferred way of creating a Border object?