code: public void addOverlay(Overlay overlay, int layer) {
  		if (overlay==null) throw new NullPointerException();
  		OverlayComponent c=new OverlayComponent(overlay, theImage);
  		overlay.addOverlayComponent(c);
  		layeredPane.add(c, Integer.valueOf(layer));
  		layeredPane.revalidate();
  		layeredPane.repaint();
  	}
docs: Adds an overlay as the specified layer.
  @param overlay the overlay to add
  @param layer the layer to add the overlay to; higher layers are on top of lower layers;
  the image resides in layer 0