...

View Full Version : How to print a window in java



emekapromise
01-26-2012, 04:21 PM
Hi Friends!

I have been struggling to print out a receipt from my java application.

Please can anybody help me with the code to print my JFrame by clicking the print button?

Fou-Lu
01-26-2012, 05:28 PM
Awesome, oracle has a tutorial for this here: http://docs.oracle.com/javase/tutorial/2d/printing/index.html
I'd suggest you make use of the javax.print and not the java.awt.print since you are using swing.
Follow the whole tutorial, and you should get exactly what you are looking for (and a lot of experience with Graphics class if you're weak with that like I am).



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum