Java applet program to draw circle

      No Comments on Java applet program to draw circle

Applet program to draw circle

This program illustrate the concept of applet program to draw circle.

  • Graphics package doesnot have method to draw circle.
  • drawOwal() method is used to draw circle.
  • drawOwal() method takes four arguments i.e. drawOwal(x,y,a,b).
  • x,y repersents the position of owal.
  • a,b repersents the width and height of owal

Applet program to draw circle

scanfcode.java

import java.awt.*;
import java.applet.*;
public class scanfcode extends Applet
{
	
  public void paint(Graphics g)
  {
	 g.drawOval(30,0,200,200);
	  
  }
 
}

scanfcode.html

<html>
<head>
<title>
<p>First applet program</p>
</title>
</head>
<body>
<applet code="scanfcode.class" width="350" height="350">
</applet>
</body>
</html>

Command

Applet program to draw circle

OUTPUT

Applet program to draw circle


Comment below if you are facing any problem.


Also read

Java applet program to display numerical values
Java applet program to display textfields
Java program to display sum of two input numbers in applet


Summary
Java applet program to draw circle
Article Name
Java applet program to draw circle
Description
This program illustrate the concept of applet program to draw circle.Graphics package does not have method to draw a circle.
Author
Publisher Name
Scanfcode
Publisher Logo

Leave a Reply

Your email address will not be published. Required fields are marked *