Exam 16: Graphics
Exam 1: Creating Java Programs68 Questions
Exam 2: Using Data74 Questions
Exam 3: Using Methods, Classes, and Objects68 Questions
Exam 4: More Object Concepts67 Questions
Exam 5: Making Decisions70 Questions
Exam 6: Looping72 Questions
Exam 7: Characters, Strings, and the Stringbuilder73 Questions
Exam 8: Arrays74 Questions
Exam 9: Advanced Array Concepts74 Questions
Exam 10: Introduction to Inheritance70 Questions
Exam 11: Advanced Inheritance Concepts70 Questions
Exam 12: Exception Handling65 Questions
Exam 13: File Input and Output74 Questions
Exam 14: Introduction to Swing Components74 Questions
Exam 15: Advanced Gui Topics69 Questions
Exam 16: Graphics74 Questions
Exam 17: Applets, Images, and Sound72 Questions
Select questions type
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)
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)
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
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)