0% found this document useful (0 votes)
2 views2 pages

Drawing a Cone in Java Applet

The document provides code to draw a cone shape in an applet by using fillPolygon, drawLine and fillArc methods. It defines x and y coordinate arrays and draws the cone base triangle with fillPolygon. It then draws the two lines connecting the base vertices to the apex using drawLine. Finally, it draws the circular top surface with fillArc.

Uploaded by

saee7390
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

Drawing a Cone in Java Applet

The document provides code to draw a cone shape in an applet by using fillPolygon, drawLine and fillArc methods. It defines x and y coordinate arrays and draws the cone base triangle with fillPolygon. It then draws the two lines connecting the base vertices to the apex using drawLine. Finally, it draws the circular top surface with fillArc.

Uploaded by

saee7390
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Practical No.

30
 Develop a program to draw a Cone.
/* <applet code=saee_applet3.class width=500 height=500></applet>*/

[Link].*;

[Link].*;

public class saee_applet3 extends Applet

public void paint(Graphics g)

[Link]("Cone", 10,10);

int x1[]={150,250,350};

int y1[]={350,100,350};

int n=[Link];

[Link]([Link]);

[Link](x1,y1,n);

[Link]([Link]);

[Link](150,350,250,100);

[Link](250,100,350,350);

[Link]([Link]);

[Link](150,300,200,100,0,-180);

}
Output:

You might also like