Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package stap0;
- import javax.swing.*;
- import java.awt.*;
- public class CopyOfZeilboot extends JPanel
- {
- private int x = 100;
- private int y = 400;
- private int breedteBoot = 200;
- private int hoogteBoot = 100;
- private int breedteMast = 15;
- private int hoogteMast = 300;
- private int schuineZijde = 50;
- public CopyOfZeilboot(int breedteMast, int hoogteMast, int breedteZeilboot, int hoogteZeilboot)
- {
- this.breedteMast = breedteMast;
- this.hoogteMast = hoogteMast;
- this.breedteBoot = breedteZeilboot;
- this.hoogteBoot = hoogteZeilboot;
- }
- public void teken( Graphics g)
- {
- int[] bootX = {x, breedteBoot + x, ((breedteBoot+ x) - schuineZijde), x + schuineZijde};
- int[] bootY = {y, y, y+hoogteBoot, y+hoogteBoot};
- int[] zeilX = {x+breedteBoot, x+breedteBoot, x};
- int[] zeilY = {x,x+breedteBoot,breedteBoot+x};
- g.setColor(Color.PINK);
- g.fillPolygon(bootX, bootY,4);
- g.setColor(Color.darkGray);
- g.fillRect(x + (breedteBoot /2), 100, breedteMast, hoogteMast);
- g.setColor(Color.CYAN);
- g.fillPolygon(zeilX, zeilY,3);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement