How To Print Jtable Data In Java Swing GUI Application – Netbeans
How To Print Jtable Data In Java Swing GUI Application – Netbeans
Its easy to print JTable data using print() method. Just invoke JTable.print() without the arguments. The printing process starts instantly after you click print button. You are prompted to choose the file destination location (Where the file will be saved). After entering the file name and clicking open button the document is printed immediately.
public void printJavaJFrameJTable() { try { boolean print = jTable1.print(); if (!print) { JOptionPane.showMessageDialog(null, "Unable To Print !!.."); } } catch (PrinterException ex) { JOptionPane.showMessageDialog(null, ex.getMessage()); } }