Advertisement
Guest User

Lab04G_BIL

a guest
Oct 9th, 2015
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.80 KB | None | 0 0
  1. import java.awt.*;
  2. import java.awt.event.*;
  3.  
  4. public class Lab04G_BIL
  5. {
  6.     public static void main(String args[])
  7.     {
  8.         GfxApp gfx = new GfxApp();
  9.         gfx.setSize(900,700);
  10.         gfx.addWindowListener(new WindowAdapter(){public void
  11.         windowClosing(WindowEvent e){System.exit(0);}});
  12.         gfx.show();
  13.        
  14.         }
  15.     }
  16.  
  17. class GfxApp extends Frame
  18. {
  19.     public void paint(Graphics g)
  20.     {
  21.         g.drawLine(145,145,230,40);
  22.         g.drawLine(295,145,230,40);
  23.         g.drawLine(150,100,230,40);
  24.         g.drawLine(145,145,295,145);
  25.         g.drawLine(145,145,150,100);
  26.        
  27.         g.fillOval(500,242,200,200);
  28.         g.setColor(Color.white);
  29.         g.fillOval(515,251,175,175);
  30.         g.setColor(Color.blue);
  31.         g.fillOval(529,260,150,150);
  32.         g.setColor(Color.red);
  33.         g.fillOval(545,269,125,125);
  34.         g.setColor(Color.yellow);
  35.         g.fillOval(575,295,75,75);
  36.    
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement