Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.Color;
- import java.util.Random;
- public class BallPanel extends javax.swing.JPanel implements Mover
- {
- private final int INIT_X = 75;
- private final int INIT_Y = 75;
- private final int DIAMETER = 60;
- private final int INTERVAL = 5;
- private MoveTimer _timer;
- private int _x;
- public BallPanel()
- {
- super();
- this.setBackground(java.awt.Color.white);
- /* object = new BouncingBall(COLOR, this);
- object.setLocation(Math.random()*1280, Math.random()*1040);
- object.setSize(DIAMETER, DIAMETER);*/
- _timer = new MoveTimer (INTERVAL, this);
- _timer.start();
- }
- public void move()
- {
- //object.move();
- this.repaint();
- }
- public void paintComponent(java.awt.Graphics aBrush)
- {
- super.paintComponent(aBrush);
- java.awt.Graphics2D betterBrush = (java.awt.Graphics2D) aBrush;
- //object.fill(betterBrush);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement