Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package h05_apioefening;
- import java.awt.*;
- public class Tralies
- {
- private int x, y, width, height;
- private int grootte = 200;
- private boolean raised;
- public Tralies(int x, int y, int width, int height, boolean raised)
- {
- this.x = x;
- this.y = y;
- this.width = width;
- this.height = height;
- this.raised = raised;
- }
- public void tekenen(Graphics g)
- {
- int smile_y = x + 30;
- int smile_x = x + 30;
- // maak smile :D
- g.setColor(Color.yellow);
- g.fillOval(smile_x, smile_y, grootte, grootte);
- // maak de ogen
- g.setColor(Color.black);
- g.fillOval(smile_x + ((grootte / 2)), smile_y + (smile_y / 8),
- grootte / 5, grootte / 5);
- g.fillOval((smile_x - 50) + ((grootte / 2)), smile_y + (smile_y / 8),
- grootte / 5, grootte / 5);
- // maak de lach
- g.setColor(Color.white);
- g.fillArc(smile_x + 50, smile_y + (smile_y / 2), grootte / 2,
- grootte / 2, -180, 180);
- // maak het venster van de tralies
- g.setColor(Color.black);
- g.draw3DRect(x, y, width, height, raised);
- // maak de tralies
- g.setColor(Color.gray);
- for (int i = 0; i < 280; i += 40)
- {
- g.fillRoundRect(x + i, y, 10, height, 10, 20);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement