MessageFormat header = new MessageFormat("Report Print");
MessageFormat footer = new MessageFormat("Page[0,number,integer]");
try {
table.print(JTable.PrintMode.FIT_WIDTH, header, footer);
}catch(Exception e){
JOptionPane.showInternalMessageDialog(null, "Unable to Print");
}