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
If you want to change graphic output on a panel in response to a user's mouse click, you would place a call to ____ in the actionPerformed() method.
(Multiple Choice)
5.0/5
(30)
In Java, whether a paint request is triggered by the system or an application, a Component's paint() method is invoked.
(True/False)
4.7/5
(41)
A rectangle created with the clearRect() method is not transparent.
(True/False)
4.9/5
(40)
You can instantiate an empty Polygon object using which of the following statements?
(Multiple Choice)
4.8/5
(42)
____ is the amount of space between the bottom of the descent of one line and the top of the characters in the successive line of type.
(Multiple Choice)
4.9/5
(28)
You can discover the fonts that are available on your system by using the ____ method.
(Multiple Choice)
4.7/5
(42)
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.7/5
(37)
To create an arc object named halfArc that looks like the top half of a circle, which of the following statements can you use to produce identical results to this statement? halfArc.drawArc(x, y, w, h, 0, 180); .
(Multiple Choice)
4.9/5
(44)
The ____ method requires four arguments and draws the outline of a rectangle using the current drawing color.
(Multiple Choice)
4.8/5
(28)
import javax.swing.*;
import java.awt.*;
import java.awt.Color;
public class JDemo3DRectangles extends JPanel
{
@Override
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)
{
JFrame frame = new JFrame();
frame.add(new JDemo3DRectangles());;
frame.setSize(200, 180);
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.9/5
(34)
Match each term with the correct statement below.
Correct Answer:
Premises:
Responses:
(Matching)
4.9/5
(32)
You can instruct a Graphics object named g to produce green output by using which of the following statements?
(Multiple Choice)
4.9/5
(43)
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.9/5
(32)
The drawPolygon() method requires four arguments, two integer arrays, and two single integers.
(True/False)
4.8/5
(32)
Write the statement to create a Rectangle2D.Float object named myRect at 20, 20 with a width of 80 and height of 50.
(Essay)
4.8/5
(32)
In the drawPolygon() method, what are the three arguments and what values do they represent?
(Essay)
4.8/5
(35)
Showing 21 - 40 of 66
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)