Java How to Program, 11/e Multiple Choice Test Bank 1 of 4
Chapter 35: GUI, Part 2
Section 35.2 JSlider
35.2 Q1: A JSlider cannot display which of the following:
a. Major tick marks.
b. Minor tick marks labels.
c. Minor tick marks.
d. Snap-to ticks.
35.2 Q2: Arrow keys can manipulate a JSlider object. Which of the following statements does not correctly
describe how the arrow keys are used?
a. The left-arrow and right arrow keys decrease or increase (respectively) the thumb of the JSlider by 1.
b. The down-arrow and up-arrow keys decrease or increase (respectively) the thumb of the JSlider by 1.
c. The PgDn and PgUp keys decrease or increase (respectively) by block increments of one-tenth of the range
of values.
d. The Home key and End key move the thumb to the maximum or minimum (respectively) value of the
JSlider.
35.2 Q3: JSliders generate what type of event?
a. ActionEvents.
b. ChangeEvents.
c. WindowEvents.
d. MouseEvents.
Section 35.3 Understanding Windows in Java
35.3 Q1: A JFrame supports three operations when the user closes the window. Which of the choices below is not
one of the three:
a. DISPOSE_ON_CLOSE.
b. DO_NOTHING_ON_CLOSE.
c. LOWER_ON_CLOSE.
d. HIDE_ON_CLOSE.
35.3 Q2: Which of the following is not one of the seven methods for handling window events?
a. windowClosing.
b. windowClosed.
c. windowOpening.
d. windowOpened.
35.3 Q3: Which of the following is false?
a. JFrame is a lightweight component.
b. JFrame is a subclass of Frame (which is a subclass of Window).
c. JFrames have a title bar and a border.
d. A JFrame window will look like all other windows displayed on that platform.
35.3 Q4: What happens if setSize is not called on a window?
a. The window is displayed at its preferred size.
b. It is a syntax error.