Skip to content
Related Articles
Open in App
Not now

Related Articles

Draw an Olympic Symbol in Java Applet

Improve Article
Save Article
  • Last Updated : 22 Apr, 2022
Improve Article
Save Article

Given task is to draw an Olympic symbol in Java Applet.

Expected Output:


Approach: Use drawOval() method to draw a circle with x and y coordinates and length and breadth.

Below is the implementation of the above approach: 

Applet Program: 


// Java program to Draw an Olympic
// Symbol using Java Applet
import java.applet.*;
import java.awt.*;
/*<applet code="Olympics" width=600 height=600>
public class Olympics extends Applet {
    public void paint(Graphics g)
        g.drawOval(30, 30, 30, 30);
        g.drawOval(50, 45, 30, 30);
        g.drawOval(70, 30, 30, 30);
        g.drawOval(90, 45, 30, 30);
        g.drawOval(110, 30, 30, 30);



Note: To run the applet in command line use the following commands

> javac
> appletviewer

You can also refer to: to run applet program.

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!