0

I have JTable which looks correct in program, but then I print it where is no borders above columns and rows only one border above all table.

Here is print code:

MessageFormat header = new MessageFormat("Print Report");
MessageFormat footer = new MessageFormat("Page{0,number,integer}");
try {
    registras_table.print(JTable.PrintMode.FIT_WIDTH, header, footer);
} catch (PrinterException ex) {
    Logger.getLogger(pagrindinis.class.getName()).log(Level.SEVERE, null, ex);
}

How to set that borders for printing? Thank you!

MadProgrammer
  • 343,457
  • 22
  • 230
  • 366
Rytis
  • 59
  • 8
  • 1
    Hmm, [this example](http://stackoverflow.com/questions/24977871/printing-selected-component-of-jframe-to-printer/24978159#24978159) and [this example](http://stackoverflow.com/questions/26580954/how-to-print-selected-rows-jtable/26581137#26581137) both seem to work okay... – MadProgrammer Dec 01 '14 at 21:52
  • Thank you for answer, but this didn't helped me, I added UIManager, but it prints it same, maybe somehow I need to add borders manually only for printing? I didn't see anything like that in your examples. – Rytis Dec 01 '14 at 22:05
  • Or maybe that borders is not really black because I can print only black. – Rytis Dec 01 '14 at 22:10
  • Oh that was that, I selected to print everything in black and it printed borders -.-. Sorry for your spent time. – Rytis Dec 01 '14 at 22:13

0 Answers0