Les Morgan wrote:
without packing objects may not be in their proper location to be displayed.
I can never get pack() to work; I think you have to call setPreferredSize() on (at least some of) the Components before pack() will give a sensible size to the whole display. As others have said, the real problem is calling setVisible too early. It isn't just force of habit.
I think you don't need to use preferred sizes if you use grid bag; use fill constraints instead. I suggest you find out about
Horstmann's GBC class which makes grid bag easier to use.