programme:- to draw a oval and fill the color in shape of oval outside it in applet.
import java.awt.*;
import java.applet.*;
//<applet code="cartoon" height="300" width="300"></applet>
public class cartoon extends Applet
{
public void paint(Graphics g)
{
g.drawString("welcome to applet cartoon",80,20);
g.drawOval(50,100,100,100);
g.setColor(Color.blue);
g.fillOval(150,100,100,100);
}
}
import java.awt.*;
import java.applet.*;
//<applet code="cartoon" height="300" width="300"></applet>
public class cartoon extends Applet
{
public void paint(Graphics g)
{
g.drawString("welcome to applet cartoon",80,20);
g.drawOval(50,100,100,100);
g.setColor(Color.blue);
g.fillOval(150,100,100,100);
}
}
No comments:
Post a Comment