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 frame resize Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "frame resize" Watch "frame resize" New topic
Author

frame resize

praveen shinde
Ranch Hand

Joined: Jun 03, 2009
Posts: 63
Hello
I have a frame which consist of several textfield, combobox, panels etc. When I run the program all the components are not arranged properly. But when I maximize the frame all the components are arranged properly. I tried changing the size of the frame. But it didn't work.
Thanks
Praveen
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2157
    
    7
You question is too vague to give any specific help so all I can do is suggest you read the section from the Swing tutorial on Using Layout Managers for working examples.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10175
    
    8

Are you adding your components after the call to JFrame#setVisible(true)?


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
praveen shinde
Ranch Hand

Joined: Jun 03, 2009
Posts: 63
I have added all the components to the frame and then used JFrame#setVisible(true)
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
almost certainly you are using the wrong layout manager
Bharath Raja
Ranch Hand

Joined: Jan 21, 2009
Posts: 111
try to use the pack() method of JFrame class


Life is either daring something or nothing - Helen Keller
 
Consider Paul's rocket mass heater.
 
subject: frame resize
 
Similar Threads
Automatic Layout cuts off labels - Modified headfirst beatbox
unable to see dynamically added component in swing
HMVC Frame Refreshing
Getting Dimensions (Screen Size)dynamically
Panel not repainting