Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to solve this problem.  RSS feed

 
kishor patankar
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!!! Friend,
Is it possible to redisplay components without using validate/invalidate and event? The class is extended to the frame. Considered that I am using outside of the init()/constructor.
Thanks In Advance,
Kishor
 
Scott Pedigo
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't give a good answer without knowing more about what you are really trying to do. I.e. what is wrong with using invalidate? Under what circumstances do the components need to be redisplayed? Is the parent container being resized for example? I have an applet where I make some components visible/hidden, depending on what button is pressed. I need to invalidate the parent container to get the layout redone after modifying what is visible. Just doing a repaint() alone is not sufficient. But for some other things I have overridden the paint() method. If you do that, you can draw or display whatever you want.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!