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 problems in refreshing a Frame window after any event Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "problems in refreshing a Frame window after any event" Watch "problems in refreshing a Frame window after any event" New topic
Author

problems in refreshing a Frame window after any event

Manoj Syoran
Greenhorn

Joined: Nov 04, 2011
Posts: 7
Sir I am finding problems in refreshing a Frame window after any event.
I have to minimize or maximize the frame to refresh and get new components visible.
Please, Help me get rid of the problem.
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
any time a container is visible, when components are added/removed/whatever'ed, you need to call
[container].validate(); (AWT), or
[container].revalidate(); (Swing)

and, in most cases, followed by
[container].repaint();
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19719
    
  20

Please UseAMeaningfulSubjectLine. In an entire forum about Swing, AWT, SWT and JFace, "AWT" is nowhere near meaningful. I've changed it for you this time.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Manoj Syoran
Greenhorn

Joined: Nov 04, 2011
Posts: 7
Sorry sir for Subject code.I will take care next time.
Sir I don't find validate function useful in rereshing the frame window.
Still I have to maximize the frame to get any change in components.
Any new component such as a Label get displayed after maximizing the frame window.
The label do not get displayed after any event such as clicking a button.
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
you'll need to post a sample program that demonstrates the problem.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problems in refreshing a Frame window after any event