Advertisement
Guest User

Untitled

a guest
Apr 26th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. import java.awt.Color;
  2. import java.util.Random;
  3. public class BallPanel extends javax.swing.JPanel implements Mover
  4. {
  5. private final int INIT_X = 75;
  6. private final int INIT_Y = 75;
  7. private final int DIAMETER = 60;
  8. private final int INTERVAL = 5;
  9. private MoveTimer _timer;
  10. private int _x;
  11.  
  12. public BallPanel()
  13. {
  14. super();
  15. this.setBackground(java.awt.Color.white);
  16.  
  17. /* object = new BouncingBall(COLOR, this);
  18. object.setLocation(Math.random()*1280, Math.random()*1040);
  19. object.setSize(DIAMETER, DIAMETER);*/
  20.  
  21. _timer = new MoveTimer (INTERVAL, this);
  22.  
  23. _timer.start();
  24.  
  25. }
  26.  
  27. public void move()
  28. {
  29. //object.move();
  30.  
  31.  
  32. this.repaint();
  33. }
  34.  
  35. public void paintComponent(java.awt.Graphics aBrush)
  36. {
  37. super.paintComponent(aBrush);
  38. java.awt.Graphics2D betterBrush = (java.awt.Graphics2D) aBrush;
  39. //object.fill(betterBrush);
  40.  
  41.  
  42. }
  43.  
  44.  
  45.  
  46.  
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement