Code example for OverlayLayout

0
 
    /** 
     * Constructor. 
     */ 
    protected SurfacePlot() { 
        setLayout( new OverlayLayout( this ) );
    } 
 
    /** 
     * Sets the plotting surface which draws axes and other decorations 
     * that form the background to the actual plotted points. 
     * This must be called before the component is drawn. 
     * 
     * @param  surface  plotting surface implementation 
     */ 
    public void setSurface( PlotSurface surface ) {
        if ( surface_ != null ) {
            Component comp = surface_.getComponent();
            remove( comp );
        } 
Contextual code suggestions in your IDE  Get Codota for Java