Sunday, March 26, 2017
In dữ liệu từ Table trong Java swing gui How to Print Tables Print JTable in Java swing gui
In dữ liệu từ Table trong Java swing gui How to Print Tables Print JTable in Java swing gui
Print JTable in Java swing gui
Java gui 2016
public void Print(JTable table,String head) {
MessageFormat header = new MessageFormat(head);
MessageFormat footer = new MessageFormat("Page {0,number,integer}");
try {
table.print(JTable.PrintMode.FIT_WIDTH, header, footer);
} catch (java.awt.print.PrinterException ep) {
JOptionPane.showMessageDialog(null, "Error "+head.toLowerCase()+"!");
}
}
Available link for download