Saturday, November 17, 2012

Code used in video "Java prog#26.How to print JTable in Java netbeans"

Here I am providing the downloadable code link of  the Java code I have used in the video
 "Java prog#26.How to print JTable in Java netbeans"  of my YouTube channel ProgrammingKnowledge

Click Link to watch the video LINKThis code below is for the cmd_printActionPerformed  method action perform

MessageFormat header = new MessageFormat("Your Header name ");
        MessageFormat footer = new MessageFormat("Page {0,number,integer}      ");
        try {
            jTable1_pumpdata.print(JTable.PrintMode.FIT_WIDTH, header, footer, true, null, true, null);
            //table.print(JTable.PrintMode.FIT_WIDTH, header, null);
           // jTable1_pumpdata.print(JTable.PrintMode.FIT_WIDTH, header, footer);
        } catch (java.awt.print.PrinterException e) {
            System.err.format("Cannot print %s%n", e.getMessage());