The following code attempts to draw a black-filled outer rectangle with a white-filled inner circle inside it:

Question:

The following code attempts to draw a black-filled outer rectangle with a white-filled inner circle inside it:

DrawingPanel panel = new DrawingPanel(200, 100);

Graphics g = panel.getGraphics();

g.setColor(Color.WHITE);

g.fillOval(10, 10, 50, 50);

g.setColor(Color.BLACK);

g.fillRect(10, 10, 50, 50);

However, the graphical output looks like Figure 3G.19 instead. What must be changed for it to look as intended?

* Drawing Panel

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: