Exam 16: Graphics
Exam 1: Creating Java Programs61 Questions
Exam 2: Using Data67 Questions
Exam 3: Using Methods Classes and Objects66 Questions
Exam 4: More Object Concepts66 Questions
Exam 5: Making Decisions66 Questions
Exam 6: Looping66 Questions
Exam 7: Characters Strings and the Stringbuilder68 Questions
Exam 8: Arrays66 Questions
Exam 9: Advanced Array Concepts66 Questions
Exam 10: Introduction to Inheritance66 Questions
Exam 11: Advanced Inheritance Concepts66 Questions
Exam 12: Exception Handling66 Questions
Exam 13: File Input and Output66 Questions
Exam 14: Introduction to Swing Components66 Questions
Exam 15: Advanced Gui Topics66 Questions
Exam 16: Graphics66 Questions
Select questions type
How can a programmer find and gather all the available fonts on a computer system?
(Essay)
4.7/5
(80)
Write the statement to draw a rectangle using a graphics object named myRect that begins at position 30, 100 and is 150 pixels wide by 40 pixels tall.
(Short Answer)
4.7/5
(72)
Which FontMetrics class method returns information about the part of characters that hang below the baseline?
(Multiple Choice)
4.9/5
(85)
The lineTo() method is used to define the beginning point of a polygon.
(True/False)
4.9/5
(79)
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
(80)
Write the statement that will create a BasicStroke object named myLine and make it the current stroke. The line width should be 3, the endcap style should be CAP_ROUND and the juncture style should be JOIN_BEVEL .
(Essay)
4.8/5
(73)
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
(68)
The ____ method provides information about the system in use.
(Multiple Choice)
4.9/5
(91)
You use the ____________________ method in statements to add points to a polygon.
(Short Answer)
4.8/5
(62)
You can instruct a Graphics object to use a font by inserting the font as the argument in a ____ method.
(Multiple Choice)
4.9/5
(81)
BasicStroke class variables determine the endcap and ____ style arguments.
(Multiple Choice)
4.9/5
(87)
Which of the following statements will correctly add a point to a polygon named myShape ?
(Multiple Choice)
5.0/5
(81)
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
(80)
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.9/5
(89)
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)
5.0/5
(78)
The getScreenSize() method returns an object of type Pixels , which specifies the width and height of the screen in pixels.
(True/False)
4.7/5
(89)
The first step in drawing a 2D object is to specify how a drawn object is rendered.
(True/False)
4.9/5
(76)
Write the setPaint() statement that will set a cyclic gradient that cycles between red and yellow that begins at coordinates 40, 60 and ends at coordinates 210, 120. The 2D graphics object you use in the statement should be named graph2D.
(Essay)
4.8/5
(95)
Write the statement that uses an object named brush to draw a string that says "I'm here" with the lower-left corner of the string appearing at coordinates x=100, y=110.
(Short Answer)
4.8/5
(90)
Showing 41 - 60 of 66
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)