layout.removeComponent(getComponentAt(i));
layout.removeComponent(getComponent(i));
    public void setLayout(SLayoutManager l) {        if (layout != null) {            for ( int i=0; i<getComponentCount(); i++ ) {                layout.removeComponent(getComponentAt(i));            }            layout.setContainer(null);        }        layout = l;        if ( layout!=null ) {            for ( int i=0; i<getComponentCount(); i++ ) {                layout.addComponent(getComponentAt(i), getConstraintAt(i), i);            }            layout.setContainer(this);        }    }