Guest User

Untitled

a guest
Jul 17th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. import java.applet.*;
  2. import java.awt.*;
  3.  
  4. public class apps {
  5.  
  6. int tabX [] = {322,322,322,342,352,362,372,382,382,322};
  7. int tabY [] = {220,170,160,170,160,170,160,170,220,220};
  8.  
  9. public void paint(Graphics g) {
  10.  
  11. g.drawLine(120,120,160,40);
  12. g.drawLine(160,40,320,30);
  13. g.drawLine(320,40,360,120);
  14. g.drawLine(120,120,360,120);
  15. g.drawLine(160,220,320,120);
  16. g.drawLine(320,220,320,120);
  17. g.drawLine(160,220,320,220);
  18.  
  19. g.setColor(Color.red);
  20. g.fillPolygon(tabX, tabY, 10);
  21.  
  22. g.setColor(Color.yellow);
  23. g.fillOval(30,20,50,50);
  24. g.setColor(Color.green);
  25. g.fillRect(0,221,400,50);
  26.  
  27. Image img;
  28. img=getImage(getDocumentBase(),"drzewo.gif");
  29. g.drawImage(img,0,95,this);
  30. }
  31. }
Add Comment
Please, Sign In to add comment