In my Application, I have a JTable with data and I need to add a print button which adds the functionality of printing the data in a table on printer paper (send a printer job), how is that possible using the PrinterJob' class?
I’ve been searching around for examples, but I couldn’t find a simple example that prints some data from a JComponent.
This is one of the Websites I found: http://java.sun.com/products/java-media/2D/forDevelopers/sdk12print.html.
But I am not sure what to focus on to understand how printing works (page format …etc).
Thanks
hmmm,
todays Java6 Oracle tutotial about printing http://download.oracle.com/javase/tutorial/2d/printing/index.html contains http://download.oracle.com/javase/7/docs/api/javax/swing/JTable.html#print%28%29 which is described in JTable Tutorial including Runnable Examples, then you have to search (on this forum too) for correct Print paginations and orientations
for example
note: I’m not sure that is possible correctly set Font, FontSize and FOntColor for PrintHeader and PrintFooter for JTable Printing