dshrenik
asked on
Java Swing: Components don't show up
I am adding a JPanel to another JPanel. The problem is that the inner JPanel does not show up until I click at the location where it is supposed to appear.
Please let me know what I could be missing. Thanks!
Please let me know what I could be missing. Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Unfortunately, I'm not allowed to paste code. Sorry about that!
Can you tell me some possible things that could be going wrong?
Can you tell me some possible things that could be going wrong?
I think HonorGod has a good point - are you indedadding the second ;panel after you show the window?
In general, unless there is some specvial need - just create all GUI first and then show
the window when all elements are already created and are in place, then say
setVisible(true);
the window when all elements are already created and are in place, then say
setVisible(true);
ASKER
I am not sure. Sorry if question sounds silly - I am new to Swing:
What is the frame here, and how do I get a reference to it?
Do I just say this.repaint()? (where this is a jpanel)?
What is the frame here, and how do I get a reference to it?
Do I just say this.repaint()? (where this is a jpanel)?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thanks for the grade & points.
Good luck & have a great day.
Good luck & have a great day.
It is very common to add one JPanel to another JPanel - should not have any problems