Deck 18: Swing II

Full screen (f)
exit full mode
Question
A view port shows only part of the text at one time.
Use Space or
up arrow
down arrow
to flip the card.
Question
All of the following are methods of the class Color except:

A)getRed
B)brighter
C)darker
D)dimmer
Question
When using scroll bars,the text is viewed through a ______________ that shows only part of the text at a time.

A)view port
B)text area
C)all of the above
D)none of the above
Question
The paint method of the Graphics class can only be used with Applets.
Question
The Insets class is in the package ______________.

A)java.awt
B)javax.swing
C)java.util
D)java.lang
Question
The method paint has one parameter of type:

A)Shape
B)Graphics
C)Image
D)String
Question
Java uses a coordinate system whose origin point 0,0)is located at the upper-left corner of the screen area.
Question
An invocation of the Container class method _____________ updates components on the screen.

A)setVisible
B)setLayout
C)update
D)validate
Question
Icons can be added to:

A)JLabels
B)JButtons
C)JMenuItems
D)all of the above
Question
An imaginary _____________ is used for drawing all shapes on the screen.

A)bounding box
B)view port
C)container
D)none of the above
Question
Any change to graphics being displayed on the screen requires a call to the method ____________ to update the graphics.

A)paint
B)repaint
C)update
D)all of the above
Question
A window listener must define all the method headings in the WindowListener interface,even if some are trivial implementations.
Question
To by pass implementing all methods in the WindowListener interface,make the window listener a derived class of:

A)WindowEvent
B)ActionEvent
C)WindowAdapter
D)None of the above
Question
The Graphics class is an)____________ class.

A)discrete
B)concrete
C)abstract
D)none of the above
Question
You can use the Java method ______________ from the Color class to change the drawing color.

A)changeColor
B)getColor
C)setColor
D)useColor
Question
When the user clicks any of the three standard JFrame buttons,a ___________ is generated.

A)window listener
B)window event
C)window activator
D)window deactivator
Question
If the policies for scroll bars are never set then the scroll bars will never be visible.
Question
The dispose method of the JFrame class terminates a Java program.
Question
All of the following are methods of the Graphics class except:

A)drawRect
B)fillRect
C)coloredRect
D)fill3DRect
Question
The class JFrame has a method named __________ that eliminates the invoking JFrame without terminating the program.

A)close
B)dispose
C)eliminate
D)None of the above
Question
The drawArc method of the Graphics class requires a starting angle.A positive starting angle indicates a clockwise direction.
Question
Write a Java statement that draws a filled oval at position 150,100)with a height of 100 and a width of 50.
Question
Explain the Java coordinate system for graphic objects.
Question
Write a Java statement to create a scroll pane for a text area named productDescription.
Question
The Java Color class mixes amounts of red,green and yellow to produce any new color you might want.
Question
Set policies for the scroll bar created in number 3 above.
Question
Write Java statements to add the icon created in number 1 above to a label that says "Love".
Question
A rounded rectangle is a rectangle whose corners have been replaced by arcs.
Question
Write a Java statement to create an image icon for the image heart.gif.
Question
The class JColorChooser can be used to produce a dialog window that allows you to choose a color by looking at color samples.
Question
Write a Java statement that uses a Graphics object to display "Hello World" at position 50,100.
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/31
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 18: Swing II
1
A view port shows only part of the text at one time.
True
2
All of the following are methods of the class Color except:

A)getRed
B)brighter
C)darker
D)dimmer
D
3
When using scroll bars,the text is viewed through a ______________ that shows only part of the text at a time.

A)view port
B)text area
C)all of the above
D)none of the above
A
4
The paint method of the Graphics class can only be used with Applets.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
5
The Insets class is in the package ______________.

A)java.awt
B)javax.swing
C)java.util
D)java.lang
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
6
The method paint has one parameter of type:

A)Shape
B)Graphics
C)Image
D)String
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
7
Java uses a coordinate system whose origin point 0,0)is located at the upper-left corner of the screen area.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
8
An invocation of the Container class method _____________ updates components on the screen.

A)setVisible
B)setLayout
C)update
D)validate
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
9
Icons can be added to:

A)JLabels
B)JButtons
C)JMenuItems
D)all of the above
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
10
An imaginary _____________ is used for drawing all shapes on the screen.

A)bounding box
B)view port
C)container
D)none of the above
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
11
Any change to graphics being displayed on the screen requires a call to the method ____________ to update the graphics.

A)paint
B)repaint
C)update
D)all of the above
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
12
A window listener must define all the method headings in the WindowListener interface,even if some are trivial implementations.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
13
To by pass implementing all methods in the WindowListener interface,make the window listener a derived class of:

A)WindowEvent
B)ActionEvent
C)WindowAdapter
D)None of the above
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
14
The Graphics class is an)____________ class.

A)discrete
B)concrete
C)abstract
D)none of the above
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
15
You can use the Java method ______________ from the Color class to change the drawing color.

A)changeColor
B)getColor
C)setColor
D)useColor
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
16
When the user clicks any of the three standard JFrame buttons,a ___________ is generated.

A)window listener
B)window event
C)window activator
D)window deactivator
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
17
If the policies for scroll bars are never set then the scroll bars will never be visible.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
18
The dispose method of the JFrame class terminates a Java program.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
19
All of the following are methods of the Graphics class except:

A)drawRect
B)fillRect
C)coloredRect
D)fill3DRect
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
20
The class JFrame has a method named __________ that eliminates the invoking JFrame without terminating the program.

A)close
B)dispose
C)eliminate
D)None of the above
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
21
The drawArc method of the Graphics class requires a starting angle.A positive starting angle indicates a clockwise direction.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
22
Write a Java statement that draws a filled oval at position 150,100)with a height of 100 and a width of 50.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
23
Explain the Java coordinate system for graphic objects.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
24
Write a Java statement to create a scroll pane for a text area named productDescription.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
25
The Java Color class mixes amounts of red,green and yellow to produce any new color you might want.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
26
Set policies for the scroll bar created in number 3 above.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
27
Write Java statements to add the icon created in number 1 above to a label that says "Love".
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
28
A rounded rectangle is a rectangle whose corners have been replaced by arcs.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
29
Write a Java statement to create an image icon for the image heart.gif.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
30
The class JColorChooser can be used to produce a dialog window that allows you to choose a color by looking at color samples.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
31
Write a Java statement that uses a Graphics object to display "Hello World" at position 50,100.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 31 flashcards in this deck.