Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Stap0;
- import java.awt.Color;
- import java.awt.Graphics;
- import javax.swing.JPanel;
- //Author: AndrΓ© van Ginkel
- public class VissenKomPaneel extends JPanel
- {
- private int tafelHoogte = 100;
- private int komGrootte = 240;
- private Vis visje;
- public VissenKomPaneel()
- {
- visje = new Vis(this.getWidth()/2 - komGrootte/2 +10,this.getHeight() - tafelHoogte - komGrootte*4/6,komGrootte/3,komGrootte/3);
- }
- public void paintComponent(Graphics g)
- {
- super.paintComponent(g);
- //Teken de tafel
- g.setColor(Color.RED);
- g.fillRect(0, this.getHeight() - tafelHoogte, this.getWidth(), tafelHoogte);
- //teken de vissenkom
- g.setColor(new Color(0,180,255));
- g.fillOval(this.getWidth()/2 - komGrootte/2, this.getHeight() - tafelHoogte - komGrootte*4/6, komGrootte, komGrootte*5/6);
- visje.teken(g);
- }
- }
Add Comment
Please, Sign In to add comment