@Override protected void paintComponent(Graphics g) { // TODO Auto-generated method stub super.paintComponent(g); g.setColor(Color.WHITE); g.fillRect( bounceBallBox.getBallBoxPositionX(), bounceBallBox.getBallBoxPositionY(), bounceBallBox.getBallBoxWidth(), bounceBallBox.getBallBoxHeight()); for (BounceBall bounceBall : bounceBallManager.getBallList()) { g.setColor(Color.RED); g.fillOval( bounceBall.getBallPositionX(), bounceBall.getBallPositionY(), bounceBall.getBallRadius() * 2, bounceBall.getBallRadius() * 2); } }
public BounceBallDrawComponent(BounceBallManager bounceBallManager) { // TODO Auto-generated constructor stub this.bounceBallManager = bounceBallManager; this.bounceBallBox = bounceBallManager.getBounceBallBox(); }