code: protected void centerSprite ()
      {
          if (_sprite != null) {
              Dimension d = getSize();
              int shei = _sprite.getHeight();
              int x = d.width / 2, y = (d.height + shei) / 2;
              _sprite.setLocation(x, y);
          }
      }
docs: Sets the sprite's location to render it centered within the panel.