java chapter 14 part 3
A JFrame is a descendant of each of the following classes except the __________ class?
Jar
A programmer might prefer using a JFrame instead of a Window because, unlike a window, a JFrame __________?
Has a bar and border
The statement JFrame myFrame = new JFrame(); creates a JFrame that is __________?
invisible and has no title
To create a JFrame named aFrame that is 300 pixels wide by 200 pixels tall, you can __________?
Do any of :
use the declaration JFrame aFrame = new JFrame(300, 200);
declare a JFrame named aFrame, and then code aFrame.setSize(300, 200);
declare a JFrame named aFrame, and then code aFrame.setBounds(300, 200)
When a user closes a JFrame, the default behavior is for __________?
the JFrame to become hidden and the application to keep running
An advantage of extending the JFrame class is __________?
you can set the child class properties with the class constructor
Suppose that you create an application in which you instantiate a JFrame named frame1 and a JLabel named label1. Which of the following statements within the application adds label1 to frame1?
frame1.add(label1);
The arguments required by the Font constructor include all of the following except _____?
mode
A class that controls component positioning in a JFrame is a _____ ?
layout manager
Which of the following is not true of a JTextField?
It is a type of Container.
________ are popup windows that can help a user understand the purpose of components in an application and that appear when a user hovers a mouse over the component?
Tool tips
Within an event-driven program, a component on which an event is driven is the ________?
source
A class that will respond to button press events must use which phrase in its header?
implements ActionListener
should execute an actionPerformed() method when clicked. Which statement is needed in the JFrame class?
button1.addActionListener(this);
When you use the getSource() method with an ActionEvent object, the result is __________?
an object
A class can implement __________?
as many listeners as it needs
When you write a method that reacts to JCheckBox changes, you name the method __________?
itemStateChanged()
If a class contains two components that might each generate a specific event type, you can determine which component caused the event by using the __________ method?
getSource()
To group several components, such as JCheckBoxes, so that a user can select only one at a time, you create a __________?
ButtonGroup
Suppose that you have declared a ButtonGroup named threeOptions and added three JCheckBoxes named box1, box2, and box3 to it. If you code threeOptions.setSelected(box1);, then threeOptions.setSelected(box2);, and then threeOptions.setSelected(box3);. Which box is selected?
box 3
What cannot be specified in any version of the JTextField constructor?
requiring that the value entered be non numeric
You do not need to create UI components from scratch?
True
The Window class is a child of?
Container
How would you set the size f a JFrame named first Frame to 200 pixels wide and 100 pixels high?
firstFrame.setSize(200,100);
The ________ describes how objects are arranged on screen?
Layout manager
a________is the default appearance and behavior of any user interface?
look and feel
A class can only implement one event listener?
False
When you need to perform actions based on user button clicks you use the ____________ interface?
ActionListener
The ItemListener requires the ___________ method to be implemented?
ItemStateChange ()
A(n) _______consists of a label positioned beside a square: you can click the square to display or remove a check mark?
JCheckBox
When you create a________________, you can group several components, such as JCheckBoxes, so a user can select only one at a time?
ButtonGroup
When a JComboBox appears on the screen, which option is displayed?
the default option
In addition to the JComboBoxes for which users click items presented in a list, you can create JComboBoxes into which users type text?
True