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.
If you have any problem with the code feel free to comment.
Program
import java.applet.Applet;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
public class YellowCricle extends Applet {
@Override
public void paint(Graphics g) {
//setting paint color to yellow
g.setColor(Color.YELLOW);
//creating a fill circle at point(50, 50)
g.fillOval(50, 50, 110, 110);
//setting color to red
g.setColor(Color.red);
//setting font to arial, bold, and 24 size
g.setFont(new Font("Arial", Font.BOLD, 24));
//displaying the text inside the circle
g.drawString("Go", 90, 110);
}
}
Output
Get Answers For Free
Most questions answered within 1 hours.