This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes components being shown only on maximising Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "components being shown only on maximising" Watch "components being shown only on maximising" New topic
Author

components being shown only on maximising

Vidur Koushik
Greenhorn

Joined: May 07, 2012
Posts: 16
I dont why this is happening..but..
the components that i added to a jframe are only being shown if i maximised the window..
here is a small code that i wrote...



only the frame is being shown....
not the text field that i added...

But when i maximize the window ..
i can view the textfield that i added..


This is happening with all GUI programs..
Please help me out..
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 43905
    
  33
The setVisible() call should be last. Otherwise try validate() or revalidate() after the adding calls.
Vidur Koushik
Greenhorn

Joined: May 07, 2012
Posts: 16
Perfect..sir..that worked..
thanks for the quick reply...!!
The setVisible() should indeed be the last...!!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: components being shown only on maximising
 
It's not a secret anymore!