![]() |
Printing using the Printer
The program I'm working on reads info from a MYSQL database and displays it onto a JTextArea. I need to print what is displayed, but in the API, it seems to profer printing from files. Writing to a file then printing from it is a little wierd, what can I do?
|
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. |
Ah, thank you very much. I will try it out as soon as I fix a couple critical errors...
|
| All times are GMT -5. The time now is 1:14 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC