I want to be able to set a JFrame\'s contentpane after a button inside one of that frame\'s JPanels has been clicked.
My architecture consists of a controller which
Call revalidate, then repaint. This tells the layout managers to do their layouts of their components:
JPanel contentPane = (JPanel) frame.getContentPane();
contentPane.removeAll();
contentPane.add(panel);
contentPane.revalidate();
contentPane.repaint();
Better though if you just want to swap JPanels is to use a CardLayout and have it do the dirty work.