Printing Support in Swing Components
by, 03-07-2012 at 06:53 PM (1226 Views)
Contents out of view or which are invisible because of scrolling in a scrollable window would not be present in a printout. At printer, they will be placing a dumb effect. This specified problem is usually present with larger components printing like a swing table or text components.
Multiple lines of text are present in many components that are entirely not visible at the screen. Contents shall be printed in a way that is consistent along with the screen display.
For sorting out such problems, swing tables are text components are aware of printing. For Java 2D printing, these given methods would be used.
Implementations of the contents that are required to be printed are supported by the above methods. Printable interface is implemented by an application and PrinterJob object creation is not needed.
When you call these methods, print dialog gets displayed. According to the selection of user, component data will be printed.