Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Paint a component, that is invisible or only partly visible, into an Image

800390Jul 22 2008 — edited Jul 22 2008
Hello,

I would like to render a component into an Image. This is not that hard to do, I just create a new Image object, get the graphics object from the image and use the paintComponents( g ) method of the component to draw it into the Image.

But here is my problem:

I would like to be able to render the component into the Image without displaying the image. Or another case is, when I add the component that I want to render to a container, that is smaller the the component, only the part that is visible will be rendered.


Does anyone know how to skip the optimization, that Swing does not paint on invisible areas? Or is it the case, that a component MUST be fully visible and added to another container to render it into an Image?


Thanks a lot for your help!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 19 2008
Added on Jul 22 2008
5 comments
414 views