Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. package stap0;
  2.  
  3. import javax.swing.*;
  4. import java.awt.*;
  5.  
  6. public class CopyOfZeilboot extends JPanel
  7. {
  8. private int x = 100;
  9. private int y = 400;
  10. private int breedteBoot = 200;
  11. private int hoogteBoot = 100;
  12. private int breedteMast = 15;
  13. private int hoogteMast = 300;
  14. private int schuineZijde = 50;
  15.  
  16.  
  17. private int[] bootX = {x, breedteBoot + x, ((breedteBoot+ x) - schuineZijde), x + schuineZijde};
  18. private int[] bootY = {y, y, y+hoogteBoot, y+hoogteBoot};
  19. private int[] zeilX = {x+breedteBoot, x+breedteBoot, x};
  20. private int[] zeilY = {x,x+breedteBoot,breedteBoot+x};
  21.  
  22. public CopyOfZeilboot(int breedteMast, int hoogteMast, int breedteZeilboot, int hoogteZeilboot)
  23. {
  24. this.breedteMast = breedteMast;
  25. this.hoogteMast = hoogteMast;
  26. this.breedteBoot = breedteZeilboot;
  27. this.hoogteBoot = hoogteZeilboot;
  28. }
  29.  
  30. public void teken( Graphics g)
  31. {
  32. g.setColor(Color.PINK);
  33. g.fillPolygon(bootX, bootY,4);
  34. g.setColor(Color.darkGray);
  35. g.fillRect(x + (breedteBoot /2), 100, breedteMast, hoogteMast);
  36. g.setColor(Color.CYAN);
  37. g.fillPolygon(zeilX, zeilY,3);
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement