One solution might just be to have a draw(Graphics g) method in your SpaceShip class, which uses its x and y to draw itself however you want. Then call that method from the paintComponent(Graphics g) method you overrode, passing in the Graphics as a parameter.