JFrame and/or JPanel is being weird..
807603Dec 15 2007 — edited Dec 16 2007I've made a JFrame with a menu bar. There's some options in the menu bar namely 'a' and 'b'. I have made 2 JPanels as separate classes in the same folder, and whenever I choose an option from my menu, the corresponding JPanel would show up in my JFrame. Now, the problem is, the panels don't show up straight away, only if I resize the JFrame window (Maximizing it or restoring it - minimizing doesn't work) I can get it to display, else, it just gives me a blank screen
On my next attempt, I used the removeAll () method to delete and remake everything inside the frame every time an option is chosen. That didn't help, the same thing happens.
On my latest attempt, I simply tried to add() the chosen component despite what was before it. Now the panels still won't show up unless I resize the frame, and now they are just paining on top of one another.
Am I missing some critical piece of knowledge? Please help