aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Help needed in Swing BoxLayout Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Help needed in Swing BoxLayout" Watch "Help needed in Swing BoxLayout" New topic
Author

Help needed in Swing BoxLayout

srinivas suri
Greenhorn

Joined: Nov 21, 2012
Posts: 4
/*Can someone help me why i'm getting a plane frame?? */

Wesleigh Pieters
Ranch Hand

Joined: Sep 04, 2012
Posts: 81
Please use code tags

if I compile this I get a frame with an test field, a password filed and a login button? what problems are you having exactly?
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> Can someone help me why i'm getting a plane frame??

because you've set the frame visible before adding any components.

run it, then drag the frame a little wider - do they appear now?
srinivas suri
Greenhorn

Joined: Nov 21, 2012
Posts: 4
Thank you so much! ...yah, that was the bug, i've changed the code a bit and set the setVisible to true after adding the components, it works fine now ......
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39828
    
  28
Welcome to the Ranch
Remember, setVisible() comes last.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Help needed in Swing BoxLayout