The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
October 2000

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

printing Graphics on local printer( getPrintJob )

Posted by lucas on October 03, 2000 at 2:45 AM

Hi,
My problem is that I want to print on the local printer the Graphics contents of a Frame or a Panel on wich I drawed something.
First thing I tryied is print,printAll methods of Component or any or its subclasses but is does nothing just repaints the Component(reference says these methods are designed for owerriting..).
The only thing that reacted was getPrintJob of class Toolkit.
Ok.
in the reference method is:
public abstract PrintJob getPrintJob( Frame frame, String jobtitle, Properties props ).
So i tryied this:
-I suppose i get the instance of toolkit, ex:
Tk1=FrameInst.getToolkit();
- then, try to invoke Tk1.getPrintJob(FrameInst,"Bugs Bunny", ......?????)
in the reference ITS SAYS NOTHING ABOUT WHAT Properties props
SHOLD BE, so i tryied blindly :null
and it opened a print job but the size o document was 0 and anyway no printing happened.
i tryied new Properties() but the result was the same.
so I AM BEGGING YOU, ANY OF YOU WHO KNOWS WHAT SHOULD I USE FOR props OR HAS ANY OTHER IDEEA ,PLEASE SEND ME AN ANSWER ASP.

Thank you very much.





Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us