This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Please Help me with the Print API Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Please Help me with the Print API" Watch "Please Help me with the Print API" New topic
Author

Please Help me with the Print API

seema kamath
Greenhorn

Joined: Nov 27, 2000
Posts: 14
Hello everybody,
I'am new to swings and the print API.I would like to know whether there is a way by which i can see a print preview of the stuff i wanna print.Kindly help me.
Thanks in advance
Seema Kamath
santosh desai
Greenhorn

Joined: May 13, 2001
Posts: 8
hi seema,
The printing classes of the Java platform do not supply a std "print preview" dialog.But it is easy to design ur own.
To construct a "PrintPreviewDialog",u supply either a "Printable" or a "Book",together with a "PageFormat" object.
Have a nice Day!!!
santosh
seema kamath
Greenhorn

Joined: Nov 27, 2000
Posts: 14
Hi Santosh,
Thanks for the reply.Iam sure i will have a nice day trying to design my own print preview.Thanks once again
Seema
Originally posted by santosh desai:
hi seema,
The printing classes of the Java platform do not supply a std "print preview" dialog.But it is easy to design ur own.
To construct a "PrintPreviewDialog",u supply either a "Printable" or a "Book",together with a "PageFormat" object.
Have a nice Day!!!
santosh

santosh desai
Greenhorn

Joined: May 13, 2001
Posts: 8
hi seema,
I am facing a major problem now...i am sure u can solve this for me..I have developed a swing applet to be viewed on a browser..i want to print the content of JTextArea...as of now i am getting the printDialogbox but the contents are not printing.
I am not using using the print button provided by the browser but have implemented my own like what u have done...
Please reply me ASAP regarding this...
thanx
santosh
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Please Help me with the Print API
 
Similar Threads
Printing multiple pages (Urgent)!
Printing in Java
Printing from JTextArea
Problem in the print option of JavaHelp