Write a complete program in a class named Face2 that uses the DrawingPanel to dr
ID: 645998 • Letter: W
Question
Write a complete program in a class named Face2 that uses the DrawingPanel to draw the following figure, based on the face figure from the previous problem. Use a parameterized static method to draw each face without redundancy.
window size: 320 x 180 px
faces' top-left corners at (10, 30) and (150, 50)
(You don't need to include any import statements at the top of your program. This class will be re-used in the next problem, so you may want to save it to a temporary file before moving on.)
Write a complete program in a class named Face2 that uses the DrawingPanel to draw the following figure, based on the face figure from the previous problem. Use a parameterized static method to draw each face without redundancy. window size: 320 x 180 px faces' top-left corners at (10, 30) and (150, 50) (You don't need to include any import statements at the top of your program. This class will be re-used in the next problem, so you may want to save it to a temporary file before moving on.)Explanation / Answer
import java.applet.*; import java.awt.*; /* <applet code = "face" width = 300 height = 300> </applet> */ public class face extends Applet { public void paint(Graphics g) { g.drawOval(100,100,100,100); g.fillOval(120,125,20,20); g.fillOval(160,125,20,20); g.drawLine(150,165,150,150); g.drawLine(130,170,170,170); } }
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.