Examlex
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.
Q11: Some ecofeminists believe that the source of
Q12: Label as types of euthanasia : Voluntary
Q18: Of which kind of reasoning , Act
Q18: When you create classes for others to
Q19: Which of the sexually transmitted diseases was
Q25: A(n) _ class is a class that
Q25: Label as Hypothetical (H) or Categorical (C)
Q26: Label the following examples of reasons for
Q29: If you attempt to instantiate an object
Q47: List and describe the four constructors that