If a Component doesn't know how to paint itself, then its going
to be pretty tricky getting it to paint on demand to the screen
as well as the printer.
JPanel is a container. Maybe you didn't get its children painted.
Did you try java.awt.Component.printAll(Graphics g) ?

-phil.

jav...@javadesktop.org wrote:
Hi All,

I have a special case where there is a library such as JDIC that draws directly 
to a component. Instead of using the print capabilities of the browser via 
javascript I want to print what is on the JPanel. I also want to do the same 
thing for other type of heavyweight components. I noticed if I used 
createImage(l,w) then direct the output to a BufferedImage it only gives what 
looks like the background color.

I have not seen very many examples where you capture a JPanel or other 
components where you start with the panel and not a file whose contents load 
into the panel.

Seems like printing will be an issue for JavaFX with this mixing of components 
heavyweight/lightweight so I am hoping I can get an answer here since quite a 
few Java2D people worked on JavaFX and printing might have been discussed for 
the fancy images and other unique visual imagery it was designed to handle.

As a last resort I used the awt Robot and that sort of worked but it is a 
screen capture solution not the type I really want when printing an image that 
might be bigger than the component.

Thanks,
-Tony
[Message sent by forum member 'tdanecito' (tdanecito)]

http://forums.java.net/jive/thread.jspa?messageID=328251

===========================================================================
To unsubscribe, send email to lists...@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
lists...@java.sun.com and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to lists...@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
lists...@java.sun.com and include in the body of the message "help".

Reply via email to