Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Computer Programming: Graphics

Total questions: 11

Worksheet time: 6mins

Name
Class
Date
1.
By default, graphics coordinates in Java have the origin (0,0) in the _______ corner of the drawing area.
a)
upper-left
b)
upper-right
c)
lower-left
d)
lower-right
2.
When an object of a class derived from JPanel needs to repaint itself, which method does it call?
a)
paint(g)
b)
repaint( )
c)
paintComponent(g)
d)
repaintComponent( )
3.
What are the default units for coordinates in Graphics?
a)
inches
b)
pixels
c)
centimeters
d)
millimeters
4.
With what arguments(s) is the setColor method of the Graphics class called?
a)
a Color object
b)
three integers (red, green, blue components of a color)
c)
a BasicStroke object
d)
a Paint object
5.
What font styles do Java fonts support?
a)
plain only
b)
plain and bold only
c)
plain, bold, and italic only
d)
plain, bold, italic, and bold+italic
6.
Which of the following is NOT a valid drawing method of the Graphics class?
a)
drawRect
b)
drawCircle
c)
fillOval
d)
drawPolygon
7.
What does the 'c' represent in the following method call:
g.fill3DRect(a, b, c, d, e);
a)
the x value starting position
b)
the y value starting position
c)
the width of the rectangle
d)
the height of the rectangle
8.
What does the 'b' represent in the following method call:
g.drawOval(a, b, c, d);
a)
the x value starting position
b)
the y value starting position
c)
the width of the rectangle
d)
the height of the rectangle
9.
Which of the following is true about the 'paint' method?
a)
can be called directly from your Java program
b)
automatically called in response to certain messages
c)
not the central drawing method for the application window
d)
none of these options are true
10.
Which of the following capabilities is not supported by the Graphics class?
a)
drawing filled rectangles
b)
shifting the origin in the coordinate frame
c)
rotating the coordinate frame
d)
different font sizes
11.

for g.drawArc(a, b, c, d, e, f), what does the letter 'e' represent?

a)

The beginning (start) angle

b)

the angular extent of the arc, relative to the start angle

c)

width of the arc

d)

height of the arc