java chapter 14 part 1
A JFrame is a descendant of each of the following classes except the _________________ class?
Jar
Unlike a Window, a JFrame _________________?
has a title bar and border
The statement JFrame myFrame = new JFrame(); creates a JFrame that is _________________?
invisible and has no title
Which of the following does not set a JFrame named aFrame to be 300 pixels wide by 200 pixels tall?
JFrame(aFrame(300, 200);
When a user closes a JFrame, the default behavior is for _________________?
the JFrame to be hidden and the application to keep running
An advantage of extending the JFrame class is _________________?
you can set the child class properties within 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 _________________?
It is a type of Container
Which of the following can be specified by using a parameter in one or more versions of the JTextField constructor?
the initial text in the field
Within an event-driven program, a component on which an event is generated is the _________________?
Source
A class that will respond to button-press events must use which phrase in its header?
implements ActionListener
A JFrame contains a JButton named button1 that 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 a(n) _________________?
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 twoOptions and added two JCheckBoxes named box1 and box2 to it. Which box is selected after the following statements execute?
box2