paint component to image

Hi !

I am trying to turn my Sxwing component into image.

I create a Buffered image, get a Graphics 2D and call the paint method of my compoment with my graphics2D.

For the moment my components are displayed but the purpose is no to set them visible, get an image, set this image on a 3D surface and refresh it in order ro render Swing component on 3D

For simple panel it seems to work. But for JEditorpane, JDIC Webbrowser I only get a black image. Do someone know how to get an image a this kind o component.

Anthony

[556 byte] By [neozerabbita] at [2007-11-27 4:59:43]
# 1

The component would have to be visible and at least it's size set to what you want.

I'm not sure 100%, buy maybe calling the print(Graphics) method wouldn't require visibility. Otherwise, you could create a JWindow off the screen's bounds that you can put visible components in and then paint them.

bsampieria at 2007-7-12 10:16:04 > top of Java-index,Desktop,Core GUI APIs...