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
I found a way to do what I outlined above.
Implementing the setpanel method like this:
public void setpanel(JPanel panel)
{
frame.setContentPane(panel);
frame.validate();
}
did the trick in my case.
I'm sure that I still need to fix something within my code, since pack() still shrinks the window, but at least the method posted above works.