void (JComponent content) { if (myContentPane != null) { remove(myContentPane); } myContentPane = content; myContentPane.setOpaque(true); // should be opaque add(myContentPane, BorderLayout.CENTER); }