Thursday, 15 July 2010

java - How to paint only visible area of my custom control in Swing? -



java - How to paint only visible area of my custom control in Swing? -

suppose have big custom command inscribed within jscrollpane or clipped other reasons. how determine within paintcomponent() method coordinates paint?

take @ painting in awt , swing, has first-class explanation.

but general gist is, when component painted, clipping rectangle set (nb need check how works view ports, suspect same) visible area needing updated.

you can check clip rectangle of graphics context past paint method , determine area should update.

java swing jscrollpane invalidate

No comments:

Post a Comment