I am trying to print a JTable
with the standard .print()
method.
I am using the code from this thread and it works.
However the printed table appears with very small letters. My JTable
has a font size of 14. I tried using much bigger fonts and there is a slight change in the printing result. However going over font size 16 the table on screen looks really ugly. So I need to modify printing font size.
Although I am printing using JTable.PrintMode.FIT_WIDTH
table is not enlarged to fit printing area (ie in the case when printing in landscape mode).
this is my printing routine:
MessageFormat headerFormat = new MessageFormat(str1 +" FROM " + fromDateButton.getText() + " TO " + toDateButton.getText()+"");
MessageFormat footerFormat = new MessageFormat("- {0} -");
tbSchedule.print(javax.swing.JTable.PrintMode.FIT_WIDTH, headerFormat, footerFormat);
So, my question is: How can I enlarge table to fit printing area or how can I print with bigger fonts than the ones the table on the screen has?