The moose likes Swing / AWT / SWT / JFace and the fly likes frame resize Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT / JFace
Reply Bookmark "frame resize" Watch "frame resize" New topic
Author

frame resize

praveen shinde
Ranch Hand

Joined: Jun 03, 2009
Posts: 53
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: 1644
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: 7059

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


[Donate a pint, save a life!] [How to ask questions]
praveen shinde
Ranch Hand

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

Joined: Jun 09, 2003
Posts: 3615
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
 
 
subject: frame resize
 
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture