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:

Check this out

Posted by Sudhanshu on December 18, 2001 at 2:29 AM

Hi,
Check the links below...these samples work fine.

http://www.ibiblio.org/javafaq/course/week13/09.html
http://java.sun.com/products/jdk/1.1/docs/guide/awt/designspec/printing.html

Love,
Sudhanshu


> > 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