Problem

Suppose you have the following existing program called Face that uses the DrawingPanel to...

Suppose you have the following existing program called Face that uses the DrawingPanel to draw the face figure shown in Figure 1. Modify the program to draw the modified output shown in Figure 2. Do so by writing a parameterized method that draws a face at different positions. The window size should be changed to 320 × 180 pixels, and the two faces’ top-left corners are at (10, 30) and (150, 50).

Figure 1

1	public class Face {2		public static void main(String[ ] args) {3			DrawingPanel panel = new DrawingPanel(220, 150);4			Graphics g = panel.getGraphics( );56			g.setColor(Color.BLACK);7			g.drawOval(10, 30, 100, 100);	// face outline89			g.setColor(Color.BLUE);10			g.fillOval(30, 60, 20, 20);		// eyes11			g.fillOval(70, 60, 20, 20);1213			g.setColor(Color.RED);		// mouth14			g.drawLine(40, 100, 80, 100);15		}16	}

Figure 2

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 3G
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT