This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
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

Win a copy of REST with Spring (video course) this week in the Spring forum!
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: 9168

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!