Exam 16: Graphics

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

The position of a component can be changed by using the ____ method and passing it x- and y-coordinate positions.

Free
(Multiple Choice)
4.8/5
(37)
Correct Answer:
Verified

B

To create a rectangle with rounded corners, the drawRoundRect() method is used. Describe the six arguments that are required to create rounded rectangles.

Free
(Essay)
4.9/5
(41)
Correct Answer:
Verified

The first four arguments match the four arguments required to draw a rectangle: the x- and y-coordinates of the upper-left corner, the width, and the height. The two additional arguments represent the arc width and height associated with the rounded corners (an arc is a portion of a circle). If you assign zeros to the arc coordinates, the rectangle is not rounded; instead, the corners are square. At the other extreme, if you assign values to the arc coordinates that are at least the width and height of the rectangle, the rectangle is so rounded that it is a circle.

You can use the ____ method to copy any rectangular area to a new location.

Free
(Multiple Choice)
4.7/5
(36)
Correct Answer:
Verified

B

Which of the following statements starts a polygon named pol at the coordinates 20 and 290?

(Multiple Choice)
4.8/5
(38)

Why would a programmer use the repaint() method?

(Essay)
5.0/5
(41)

The ____ method creates a solid arc.

(Multiple Choice)
4.9/5
(36)

What parameters does the copyArea() method require?

(Essay)
4.7/5
(36)

Which statement sets the font of a Graphics object named brush to boldFont?

(Multiple Choice)
5.0/5
(35)

The ____________________ method returns an object of type Dimension, which specifies the width and height of the screen in pixels.

(Short Answer)
4.8/5
(41)

The init() method of GeneralPath is used to create the beginning point of the polygon.

(True/False)
4.9/5
(36)

Describe what happens when the update() method is called.

(Essay)
4.8/5
(42)

You can instruct a Graphics object to use a font by inserting the font as the argument in a ____ method.

(Multiple Choice)
4.8/5
(49)

List the six arguments you need to provide for the drawArc() method.

(Essay)
4.8/5
(46)

Match each term with the correct statement below. -Works best with lighter drawing colors

(Multiple Choice)
4.9/5
(38)

import javax.swing.*; import java.awt.*; public class JDemoFont extends JFrame { Font bigFont = new Font("Serif", Font.ITALIC, 48); String hello = "Hello"; public void paint(Graphics brush) { super.paint(brush); brush.setFont(bigFont); brush.drawString(hello, 10, 100); } public static void main(String[] args) { JDemoFont frame = new JDemoFont(); frame.setSize(180, 150); frame.setVisible(true); } } The above code shows an application that uses the setFont() method with a Graphics object named brush. Describe what will occur when the two shaded lines of code are executed.

(Essay)
4.9/5
(41)

If the beginning and ending points used with the fillPolygon() method are ____, the two endpoints are connected by a straight line before the polygon is filled with color.

(Multiple Choice)
4.8/5
(31)

The draw3DRect() method has a ____ argument, which controls whether the rectangle is darker on the right and bottom, or lighter on the right and bottom.

(Multiple Choice)
4.9/5
(36)

Match each term with the correct statement below. -Returns the number of pixels as an integer

(Multiple Choice)
4.7/5
(41)

Match each term with the correct statement below. -A Color class constant

(Multiple Choice)
4.8/5
(33)

Match each term with the correct statement below. -Draws a solid shape

(Multiple Choice)
5.0/5
(33)
Showing 1 - 20 of 74
close modal

Filters

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