You are here: Home / Topics / Program to draw oval in Applet using drawOval() method in Java

Program to draw oval in Applet using drawOval() method in Java

Filed under: Java on 2023-10-16 07:04:38

//  Program to draw oval in Applet using drawOval() method.

import java.awt.*;
import java.applet.*;

/*
<applet code="DrawOvalTest1a" width="200" height="100" >
</applet>
*/

public class DrawOvalTest1a extends Applet  
{
public void paint(Graphics g) 
{
 setBackground( Color.yellow );
 g.drawOval (20, 20, 160, 60);  
}
}

About Author:
J
Java     View Profile
Hi, I am using MCQ Buddy. I love to share content on this website.