public void paint(Graphics g) {
      // This test is necessary because the swing thread may call this
      // method before the simulation calls SwingAnimator.update()
      if (_painter != null ) {
        // The clearRect is necessary, since JPanel is lightweight
        g.clearRect(0, 0, _width, _height);
        _painter.paint(g);
      }
    }