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 ( ) ; }
Adds an overlay as the specified layer .