Practical-1 Develop an applet that draws a circle. The dimension of the applet should be 500 x 300 pixels. The circle should be centered in the applet and have a radius of 100 pixels. Display your name centered in a circle.( using drawOval() method)

 

SimpleApplet.java

import java.awt.*;
import java.applet.*;
public class SimpleApplet extends Applet
{
public void paint(Graphics g)
{
g.drawOval(150,50,200,200);
g.drawString("Divyarajsinh",215,150);
}
}

SimpleHtml.html

<applet code= "SimpleApplet.class" width = "500" height= "300" >
</applet>

Output:


Comments

Popular posts from this blog

Write a program to check whether empty query string is entered in Asp.Net.

Mandavrayji Temple, Muli, Surendranagar, Gujarat

Write a program to change color of Label text control programmatically in Asp.Net.