In: Computer Science
Write an applet in Java that creates a yellow colored filled circle on screen. Inside this circle the word “GO” with Arial font and size 24, bold face needs to be printed. Justify your syntax
Please find the answer below.
Please do comments in case of any issue. Also, don't forget to rate
the question. Thank You So Much.
CirclePanel.java
package classes3;
/*Java Program to Draw a Human Face using Applet*/
import java.applet.Applet;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
public class CirclePanel extends Applet
{
//Initialize the applet
public void init()
{
setBackground(Color.white);
}
//Draw the human face
public void paint(Graphics g)
{
//Change color to cream
Color clr=Color.yellow;
g.setColor(clr);
//Draw and fill the face
g.fillOval(100,100,300,300);
g.setFont(new Font("arial",
Font.BOLD, 24));
g.setColor(Color.black);
g.drawString("GO", 230, 250);
resize(500,500); //resizing the
applet
}
}
output