0
Please give me a code of applet in java making smiling face 🙂👈 with different colors
Suggest me
3 odpowiedzi
+ 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.
+ 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
}
}
+ 1
Thank you 😊