Applet in java - Coder's point

Monday, March 25, 2019

Applet in java

 import java.awt.*;  
 import java.applet.*;  
 public class abc1 extends Applet  
 {  
   /*  
   <applet code='abc1.class' width=400  
   height=450>  
   </applet>  
    */  
   public void paint(Graphics g)  
   {  
     int []x={150,300,225};  
     int []y={150,150,25};  
     g.drawRect(150,150,150,200); //house  
     g.drawRect(200,200,50,150); //door  
     g.drawOval(200,75,50,50); //skylight  
     g.drawPolygon(x,y,3);  
   }  
 }  
OUTPUT:

No comments:

Post a Comment