How to solve this problem.
posted 16 years ago
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.