View Single Post
Old Oct 8th, 2006, 8:24 PM   #2
andro
Professional Programmer
 
Join Date: Oct 2005
Location: California
Posts: 319
Rep Power: 4 andro is on a distinguished road
Send a message via AIM to andro
One way to go about it would be to create a class that extends JTextArea and implements Printable.

Then you could just add a print() method, that calls printJob.setPrintable(this) along the way.


In the 1.6 JDK, all classes that inherit from JTextComponent have support for printing by default, so you won't have to do this anymore.
andro is offline   Reply With Quote