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:
Printer!!!!
Posted by NsThinh on March 20, 2001 at 8:24 PM
> 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:
|