Hello everyone, I'm having a problem with my JFrame extension. I'm making an extension of a JFrame and everything works nicely, except that none of the components inside will show until I've manually re sized the window. I don't know what to do about it. I would include code but I don't really have any idea where the root of the problem is and I've got quite a bit of code. Has anyone had or heard of such a problem? I searched the forums and the web but haven't come across anything similar. Please help! Thanks.
Not really an Applet problem.
How are you positioning and sizing the components in the JFrame?
Have you tried adjusting their sizes or the size of the JFrame?
Yep, agree. Moving to the Swing forum.
Originally Posted by Norm
This sounds like you're calling setVisible on your GUI before you've added the components. If so, you'll want to first add your components, then call pack() on the JFrame, and then call setVisible(true). If this doesn't help you, you'll probably need to post some code.
> I don't really have any idea where the root of the problem is and I've got quite a bit of code
That's where you've gone wrong. Write just a little code, just enough to compile and run and display a GUI, then run and test it. When you have that working, add some more, but again, a little at a time.
That way, if your program suddenly becomes erratic, you'll know the problem is with the last bit of code you added, and you'll be able to sort it out easily.
Note that this is the way most professional programmers work too. Nobody writes a monstrosity with hundreds of lines of code without some testing along the way.