Please give me a code of applet in java making smiling face 🙂👈 with different colors | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Please give me a code of applet in java making smiling face 🙂👈 with different colors

Suggest me

12th Jan 2023, 4:58 PM
Sharayu Deshmukh
3 Answers
+ 5
Java applets were introduced in the first version of the Java language, which was released in 1995. Beginning in 2013, major web browsers began to phase out support for the underlying technology applets used to run, with applets becoming completely unable to be run by 2015–2017. Java applets were deprecated by Java 9 in 2017.
12th Jan 2023, 6:06 PM
JaScript
JaScript - avatar
+ 2
import java.awt.*; import java.applet.*; public class SmilingFace extends Applet { public void paint(Graphics g) { g.setColor(Color.yellow); g.fillOval(50, 50, 200, 200); // face outline g.setColor(Color.black); g.fillOval(90, 100, 50, 20); // left eye socket g.fillOval(160, 100, 50, 20); // right eye socket g.setColor(Color.blue); g.fillOval(90, 100, 20, 20); // left eye g.fillOval(170, 100, 20, 20); // right eye g.drawArc(50, 160, 200, 50 , 0 , -180); // smile } }
12th Jan 2023, 6:21 PM
Reza Mardani
Reza Mardani - avatar
+ 1
Thank you 😊
13th Jan 2023, 7:08 AM
Sharayu Deshmukh