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?
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Building Java Programs A Back To Basics Approach
ISBN: 9780135471944
5th Edition
Authors: Stuart Reges, Marty Stepp
Question Posted: