Hi I hav to print a frame having JTable with some data. But its not working for me. I m using Java Print API. pls help me out.....
Jamie Young
Ranch Hand
Joined: Jun 19, 2001
Posts: 31
posted
0
This may or may not help??? This is a print method used to print text from a large text edit area. I am not quite sure how it would handle printing a table. I sure that you could print all the contents of it, but I am not sure what it would look like. Good luck!
/** * This method prints a file from the text edit area. * * @return void */ void PrintCommand() { //Frame used for PrintJob toolkit Frame frame = new Frame(); //Properties used for PrintJob toolkit Properties p = new Properties(); PrintJob pjob = getToolkit().getPrintJob (frame, "Report", p); if(pjob != null) { Graphics pg = pjob.getGraphics(); // Reset the paper's origin to allow for left 1 inch margin // 72 pts equivalent to 1 inch pg.translate(72,72); if(pg != null) { String s = BROWSEWIN_mBrowseMTEd.getText(); printLongString (pjob, pg, s); pg.dispose(); } pjob.end(); } }//end of PrintCommand()