I have proplem in java i cant print all swing compont -


hi i'm trying print swing components find code explain me gettoolkit() do? code

toolkit tkp = jpanel9.gettoolkit(); printjob pjp = tkp.getprintjob(this, null, null); graphics g = pjp.getgraphics(); jpanel9.print(g); 

i can print 1 swing component bay calling print() method not component in jpanel

you should use printall on print

from javadocs

public void print(graphics g)

prints component. applications should override method components must special processing before being printed or should printed differently painted. default implementation of method calls paint method.

the origin of graphics context, (0, 0) coordinate point, top-left corner of component. clipping region of graphics context bounding rectangle of component.

and printall...

public void printall(graphics g)

prints component and of subcomponents. origin of graphics context, (0, 0) coordinate point, top-left corner of component. clipping region of graphics context bounding rectangle of component.

possible examples...


Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -