Draw a Smiley in Java Applet
Given task is to draw a smiley face in Java Applet.
- Create three Ovals, one for the face, two for the eyes.
- Fill eyes oval with black color.
- Create an arc for the smile in the face.
Below is the implementation of the above approach:
Note: To run the applet in command line use the following commands
> javac Smiley.java > appletviewer Smiley.html
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.