File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Printing Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Printing Question" Watch "Printing Question" New topic

Printing Question

Jesse Walker
Ranch Hand

Joined: Aug 18, 2004
Posts: 50
Is there a way to make Java print the contents of a JFrame to the default printer, which class hanles that if their is?

Also, I know of the frame.dispose() method but that doesn't seem to close a JFrame, I have a multiple JFrame application with a back button option, I would like to find the best way to close the current frame, I am usinge JFrame.dispose?
Joe Ess

Joined: Oct 29, 2001
Posts: 9189

Have a look at The Java Tutorial: Printing.
Also, if you look at the Java API for Window, you'll see that dispose() doesn't do what you think it does. You first want to call setVisible()

[How To Ask Questions On JavaRanch]
I agree. Here's the link:
subject: Printing Question
It's not a secret anymore!