Questions from Starting Out With Java


Q: What is the default layout manager for a JFrame object’s

What is the default layout manager for a JFrame object’s content pane? For a JPanel object?

See Answer

Q: You want the user to be able to select only one item

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?

See Answer

Q: You want the user to be able to select any number of

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?

See Answer

Q: How do you set a frame’s size?

How do you set a frame’s size?

See Answer

Q: What is the purpose of a ButtonGroup object?

What is the purpose of a ButtonGroup object?

See Answer

Q: Do you normally add radio buttons, check boxes, or both

Do you normally add radio buttons, check boxes, or both to a ButtonGroup object?

See Answer

Q: What type of event does a radio button generate when the user

What type of event does a radio button generate when the user clicks on it?

See Answer

Q: What type of event does a check box generate when the user

What type of event does a check box generate when the user clicks on it?

See Answer

Q: Write a loop that counts the number of digits that appear in

Write a loop that counts the number of digits that appear in the String object str.

See Answer

Q: How do you determine in code whether a radio button is selected

How do you determine in code whether a radio button is selected?

See Answer