File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Why does this component appear shrunken ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Why does this component appear shrunken ?" Watch "Why does this component appear shrunken ?" New topic
Author

Why does this component appear shrunken ?

Colm Dickson
Ranch Hand

Joined: Apr 04, 2009
Posts: 89
Hi all.

I have some components on a panel and then add this panel to a container and then have my frame displayed as the result of an ActionListener on a button. Why is it that my frame is displayed but is miniscule and looks minimised, only showing the title bar?

This is really annoying. setVisible is set to true and when I expand the frame all my components appear but it will not appear correctly from the oiutset. This has to be something simple I'm missing. Any help much appreciated, thanks.




....all I see is the start of the dialog title 'Add New..'

Thanks.

Colm

pete stein
Bartender

Joined: Feb 23, 2007
Posts: 1561


It's only doing what you tell it to.

Myself, I'd try to use a combination of layouts, and then let the individual layout managers set the best size to display their contents. I'd also call pack on the window before displaying. e.g.,

Colm Dickson
Ranch Hand

Joined: Apr 04, 2009
Posts: 89
Thanks Pete,

That's it....I never even thought that my preferred size was the issue here ....

Cheers,

Colm
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why does this component appear shrunken ?