Guest User

Untitled

a guest
Apr 20th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. package Stap0;
  2.  
  3. import java.awt.Color;
  4. import java.awt.Graphics;
  5.  
  6. import javax.swing.JPanel;
  7.  
  8. //Author: AndrΓ© van Ginkel
  9.  
  10. public class VissenKomPaneel extends JPanel
  11. {
  12. private int tafelHoogte = 100;
  13. private int komGrootte = 240;
  14. private Vis visje;
  15.  
  16. public VissenKomPaneel()
  17. {
  18. visje = new Vis(this.getWidth()/2 - komGrootte/2 +10,this.getHeight() - tafelHoogte - komGrootte*4/6,komGrootte/3,komGrootte/3);
  19. }
  20.  
  21. public void paintComponent(Graphics g)
  22. {
  23. super.paintComponent(g);
  24. //Teken de tafel
  25. g.setColor(Color.RED);
  26. g.fillRect(0, this.getHeight() - tafelHoogte, this.getWidth(), tafelHoogte);
  27.  
  28. //teken de vissenkom
  29. g.setColor(new Color(0,180,255));
  30. g.fillOval(this.getWidth()/2 - komGrootte/2, this.getHeight() - tafelHoogte - komGrootte*4/6, komGrootte, komGrootte*5/6);
  31. visje.teken(g);
  32. }
  33.  
  34. }
Add Comment
Please, Sign In to add comment