Guest User

Untitled

a guest
Oct 11th, 2016
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. public class Panneau extends JPanel {
  2.  
  3. int x, y;
  4.  
  5. public int GetX() {
  6. return x;
  7. }
  8.  
  9. public int GetY() {
  10. return y;
  11. }
  12.  
  13. public void setX(int x) {
  14. this.x = x;
  15. }
  16.  
  17. public void setY(int y) {
  18. this.y = y;
  19. }
  20.  
  21. public void paintComponent(Graphics g) {
  22. g.setColor(Color.BLACK);
  23. g.fillRect(0, 0, getWidth(), getHeight());
  24.  
  25. g.setColor(Color.GREEN);
  26. g.fillOval(x, y, 30, 30);
  27. }
  28. }
Add Comment
Please, Sign In to add comment