Say we execute the following method.
The fillRect() method draws a filled rectangle.
It takes four integer parameters: the left side's
x-coordinate, the
top side's y-coordinate, the width, and the height.
import csbsju.cs160.*;
public class Q1B {
public static void run() {
DrawableFrame w;
w = new DrawableFrame();
w.show();
Graphics g = w.getGraphics();
g.fillRect(80, 40, 40, 120);
g.fillRect(40, 80, 120, 40);
g.setColor(Color.white);
g.fillRect(80, 80, 40, 40);
}
}
Complete the below window as it will appear on the screen.