Help: Container not refreshing
I recently made a GridBagLayout GUI for one of my programs (my first GUI!). The way i have it set up is there are several 'screens' that the user can view, and several buttons on the 'main screen' that correspond to the others. When a button is pressed, my action listener calls a method that clears the container, then reloads it with the components of the new screen. However, this does not actually happen when I run my program unless i take the window and resize it. Strange, right? It just stays frozen on the previous screen, unresponsive, until i take the edge of the window and resize it.
I tried this on another computer, and it does pretty much the same thing, except all the new components appear ONTOP of the old, unresponsive ones.
Here's the constructor for my GUI class, in case any of you guys can detect any problems in it:
super ("Sales Tracker");
container = getContentPane();
container.setLayout (new GridBagLayout());
c = new GridBagConstraints();
And here's one of my GUI methods for one 'screen', just the header, clearing the container, and an example of one of the new components:
public static void homeScreen()
passField = new JPasswordField(10);
c.gridx = 1;
c.gridy = 1;
c.weightx = 0.5;
Any help would be greatly appreciated, this is for an AP Computer Science class dossier, and although my teacher said he wouldn't take off points for it, it'd satisfy me and fill a missing hole in my heart if i could fix this.