JFrame's content does not appear
Hello,
I have a JFrame with some JButtons and a JLabel with an ImageIcon all organized with JPanels. About 30% of the time the content in the JFrame does not appear at all I only see the JFrame, and the other 70% of the time everything works fine. This problem occurs at random. I have a feeling that the problem may be comming from the size of the components. Could someone please tell me where this could be originating from?
Thanks in advance.
[465 byte] By [
Stefan123a] at [2007-11-27 10:26:38]

# 1
As someone else so cleverly posted today (BigDaddy LH perhaps?):
Your problem is in the code that you didn't post.
Create an SSCCE. Look here for instructions:
http://homepage1.nifty.com/algafield/sscce.html
Oh, and please use code tags so your code is readable. To learn about these, look here:
http://forum.java.sun.com/help.jspa?sec=formatting
Message was edited by:
petes1234
# 2
It would be difficult since no one know what code you have written. Try making a demo of your app that demonstrates your problem and post it here.
I'll bet that in the process of making the demo, you'll discover what you are doing wrong. Could be you've omitted a method such as pack for the frame or something or you are using the wrong layout or no layout at all or ...
Enough guessing. Clarify the problem or post some example code.
ICE
# 3
> This problem occurs at random. I have a feeling that the problem may be comming from the size of the components
So then start with frame with one component and see if the problem happens.
If it works fine then add another component.
Repeat above until you duplicate the problem.
We don't have time to guess what you are doing and by simplifying your code you will see the problem easier.
In general component need to be added to the JFrame "BEFORE" the frame is made visible.