@Override public void actionPerformed(ActionEvent e) { platform1.update(); platform2.update(); platform3.update(); platform4.update(); super.repaint(); }
@Override public void paintComponent(Graphics g) { g.setColor(Color.blue); g.fillRect(0, 0, nWidth, nHeight); g.setColor(Color.DARK_GRAY); platform1.draw((Graphics2D) g); platform2.draw((Graphics2D) g); platform3.draw((Graphics2D) g); platform4.draw((Graphics2D) g); // Get a rectangle to display with background color }