Swing Repainting components after they are dragged back into view
Posted on 2006-04-26
In a Swing app, I have made a simple component with custom painting that I use as a TreeCellRenderer for non-leaf nodes in a JTree.
However, if you grab the whole app window and drag it so that the tree (or part of it) is off the side of your monitor, when it gets dragged back in, the painting is all screwed up.
I haven't been able to find an event that tells me when a component becomes unviewable like this and when it becomes reviewable. I'd like to be able to attach a listener to such an event and just force a repaint.
Or, if there's a better way, I'm up for that, too.