Java

Java Applet - To Draw Various Shapes

Java Applet - To Draw Various Shapes
import java.awt.*; 
import java.applet.*; 

public class shap extends Applet 
{ 
public void paint(Graphics g) 
{ 
g.drawLine(25,25,100,25); 

g.drawRect(25,40,100,50); 

g.fillRect(145,40,100,50); 

g.drawRect(265,40,50,50); 

g.drawRoundRect(25,125,100,50,15,15); 

g.fillRoundRect(145,125,100,50,15,15); 

g.drawOval(25,205,100,50); 

g.fillOval(145,205,100,50); 

g.drawOval(265,205,50,50); 

g.draw3DRect(25,280,100,50,true); 

g.draw3DRect(145,280,100,50,false); 

g.drawArc(25,345,100,50,25,75); 

g.drawArc(145,345,100,50,125,75); 
} 
} 

/* <applet code = "shap.class" height = 500 width =500> 
</applet> */
Senthilvelan Sambamoorthy

Senthilvelan Sambamoorthy is working as a Professor in Department of Master of Computer Applications, Paavai Engineering College, Namakkal, Tamilnadu, India, He is Masters in Computers Applications. Having 18+ years of experience and his area of interest is Java, JSP, Servlet, J2EE, C#, PHP, Python ASP.NET, SQL Server and etc.