Hi all,
This may be a bit strange but I’m surprised it has not been asked before.
The repaint() method, according to documentation, sets everything in the bounds of the components as “dirty” and then asynchronously calls a repaint. On the other hand, changing bounds seems to be more efficient - setting only what has changed as dirty before the next repaint call.
I want to get in on that efficiency without having to change the bounds. I know I can call something like setBounds(getBounds()) but it seems gross, and I’m not even sure it would work as the bounds don’t actually change. (I haven’t tried it yet). How can I trigger an asynchronous repaint call on something who only has had some small modifications, and not repaint the whole thing?
Thanks, I need to take a better look at what’s going on with the paint calls. I thought changing bounds and calling repaint were in practice different, because when I had repaint() calls where I thought I needed them, the app would run crazy slow.
But changing bounds seems to repaint much more efficiently. Is there a different mechanism? I can’t see one in the code above.