Exam 16: Graphics

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

Match each term with the correct statement below. -Does not cycle between the colors

(Multiple Choice)
4.8/5
(40)

You use the ____________________ method in statements to add points to a polygon.

(Short Answer)
4.8/5
(41)

The ____ method provides information about the system in use.

(Multiple Choice)
4.8/5
(36)

Match each term with the correct statement below. -Used to create lines

(Multiple Choice)
4.8/5
(27)

The ____ method requires four arguments and draws the outline of a rectangle using the current drawing color.

(Multiple Choice)
4.9/5
(40)

To create an arc object named halfArc that looks like the top half of a circle, you could use the ____ statement to produce identical results to the following statement: halfArc.drawArc(x, y, w, h, 0, 180);.

(Multiple Choice)
4.8/5
(32)

BasicStroke myLine = new BasicStroke(12.0f, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_ROUND); The above statement creates a BasicStroke object and makes it the current stroke. Describe the three arguments that are used in this statement, and then describe the purpose of each.

(Essay)
4.9/5
(39)

The getFontMetrics() method can be used to discover a font's statistics. Describe the getLeading(), getAscent(), getDescent(), and getHeight() methods, and how they are used with the getFontMetrics() method.

(Essay)
4.9/5
(46)

The draw3DRect() method is used to draw rectangles that appear to have "shadowing" on two of their edges. Five arguments are used to create shadowed rectangles. Describe the five arguments.

(Essay)
5.0/5
(39)

Match each term with the correct statement below. -Controls how a drawing object is filled in

(Multiple Choice)
4.9/5
(44)

import javax.swing.*; import java.awt.*; import java.awt.Color; public class JDemo3DRectangles extends JFrame { public void paint(Graphics gr) { super.paint(gr); final int WIDTH = 60, HEIGHT = 80; gr.setColor(Color.PINK); gr.fill3DRect(20, 40, WIDTH, HEIGHT, true); gr.fill3DRect(100, 40, WIDTH, HEIGHT, false); } public static void main(String[] args) { JDemo3DRectangles frame = new JDemo3DRectangles(); frame.setSize(180, 150); frame.setVisible(true); } } The highlighted code above creates two filled 3D rectangles. Describe how the color of the rectangles is set, and explain the five arguments that are used to draw the rectangles.

(Essay)
4.7/5
(45)

If a window is 200 pixels wide by 100 pixels tall, you can place a Button named pressMe in the approximate center of the window with which of the following statements?

(Multiple Choice)
4.8/5
(33)

If you call getGraphics() in a frame that is not visible, you receive a(n) ____.

(Multiple Choice)
4.7/5
(35)

You can improve the appearance of strings drawn using Graphics objects by using the ____________________ method.

(Short Answer)
4.9/5
(41)

A Rectangle2D.Float can be created using five arguments representing the x-coordinate, y-coordinate, width, height, and position.

(True/False)
4.8/5
(36)

In the drawPolygon() method, what are the three arguments and what values do they represent?

(Essay)
4.8/5
(37)

You use the ____________________ method to draw a rectangle that appears to have "shadowing" on two of its edges-the effect is that of a rectangle that is lit from the upper-left corner and slightly raised or slightly lowered.

(Short Answer)
4.8/5
(44)

Both Rectangle2D.Float and Rectangle2D.Double can be created using four arguments representing the x-coordinate, y-coordinate, width, and height.

(True/False)
4.9/5
(36)

You can discover the fonts that are available on your system by using the ____ method.

(Multiple Choice)
4.9/5
(28)

The FontMetrics class methods return an integer value representing the font size in points, with one point measuring 1/72 of an inch.

(True/False)
4.8/5
(31)
Showing 41 - 60 of 74
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)