19 July 2016

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()+"!");
 }
}

0 nhận xét:

Post a Comment

 

BACK TO TOP

Xuống cuối trang