Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problems in refreshing a Frame window after any event

 
Manoj Syoran
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20610
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Manoj Syoran
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you'll need to post a sample program that demonstrates the problem.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic