void (@Nullable JComponent component) { if (myFirstComponent != component) { if (myFirstComponent != null) { remove(myFirstComponent); } myFirstComponent = component; if (myFirstComponent != null) { super.add(myFirstComponent); } revalidate(); repaint(); } }