Essay
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.
Correct Answer:

Verified
The fill3DRect() method is used for crea...View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Correct Answer:
Verified
View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Q28: When using the drawRoundRect() method, if you
Q29: Why would a programmer use the repaint()
Q30: To create an arc object named halfArc
Q31: The _ method creates a solid arc.<br>A)
Q32: The _ method requires four arguments and
Q34: Match each term with the correct statement
Q35: You can instruct a Graphics object named g
Q36: What are the three arguments the BasicStroke
Q37: A rectangle is drawn with the following
Q38: The drawPolygon() method requires four arguments, two