Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Printing a file

 
Gary Kephart
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a Swing app from which I want the following to happen:
1) User selects a report
2) User selects a printer from a dialog box
3) I create either an HTML String or a temp HTML file
4) I send the above to the selected printer
I took a look at the java.awt.print and javax.print packages, but neither seem to do what I want. The javax.print looks close, but I don't see any place for a user to select a printer. Any ideas?
Thanks,
Gary
 
Joel McNary
Bartender
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at the .printDialog() method of a java.awt.print.PrinterJob. That should be what you are looking for.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic