Exam 16: Graphics

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

How do you use the drawOval() method to draw an oval?

(Essay)
4.9/5
(44)

BasicStroke class variables determine the endcap and ____ style arguments.

(Multiple Choice)
4.8/5
(34)

When using the drawRoundRect() method, if you assign ____ to the arc coordinates, the rectangle is not rounded; instead, the corners are square.

(Multiple Choice)
4.8/5
(40)

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

(Multiple Choice)
4.8/5
(34)

What are the three arguments the BasicStroke constructor takes?

(Essay)
4.7/5
(43)

The drawRoundRect() method requires ____ arguments.

(Multiple Choice)
4.7/5
(27)

The statements pen.drawLine(50, 50, 100, 200); and pen.drawLine(100, 200, 50, 50); will both draw straight lines that slant down and to the right.

(True/False)
4.9/5
(36)

If a window is 100 pixels by 100 pixels, the statement goButton.setLocation(100, 100); would place the JButton component outside the window where it would be unseen.

(True/False)
4.8/5
(37)

The ____________________ method can be used when a window needs to be updated, such as when it contains new images or you have moved a new object onto the screen.

(Short Answer)
4.8/5
(37)

The first step in drawing a 2D object is to specify how a drawn object is rendered.

(True/False)
4.7/5
(41)

Write the statement to draw a rectangle that begins at position 30, 100 and is 150 pixels wide by 40 pixels tall.

(Essay)
4.9/5
(36)

How can a programmer find and gather all the available fonts on a computer system?

(Essay)
4.9/5
(36)

The ____ method draws what appears to be an empty rectangle.

(Multiple Choice)
4.8/5
(41)

Which of the following statements will correctly add a point to a polygon named myShape?

(Multiple Choice)
4.9/5
(29)

What are the constructors for the Dimension class?

(Essay)
4.9/5
(41)

The ____ method allows you to draw a String in a JFrame window.

(Multiple Choice)
4.8/5
(47)

A rectangle is drawn with the following statement: tool.drawRect(50, 50, 100, 60); An oval is drawn with the following statement: tool.drawOval(50, 50, 100, 60); Describe the resulting output, and describe how the four arguments are used to draw the objects.

(Essay)
4.8/5
(40)

import javax.swing.*; import java.awt.*; import java.awt.Color; public class JDemoRectangles extends JFrame { Container con = getContentPane(); public JDemoRectangles() { con.setBackground(Color.BLUE); con.setLayout(new FlowLayout()); } public void paint(Graphics gr) { super.paint(gr); gr.setColor(Color.RED); gr.fillRect(40, 40, 120, 120); gr.setColor(Color.YELLOW); gr.fillRect(80, 80, 160, 160); gr.clearRect(50, 60, 50, 50); } public static void main(String[] args) { JDemoRectangles frame = new JDemoRectangles(); frame.setSize(200, 200); frame.setVisible(true); } } Using the above code, describe what objects are drawn using the shaded statements of the paint() method.

(Essay)
4.9/5
(32)

A rectangle created with the clearRect() method is not transparent.

(True/False)
4.7/5
(38)

Write the statement to position a JLabel object named myLabel at the upper-left corner of a JFrame.

(Essay)
4.8/5
(29)
Showing 21 - 40 of 74
close modal

Filters

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