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()+"!");
}
}
0 nhận xét:
Post a Comment