PrintJob pj = getToolkit( ).getPrintJob( theFrame, jobTitle, null /* properties */ ); // get Printjob object. Graphics pg = pj.getGraphics(); // get Graphics object for the first page. printAll(pg); // print this component and its subcomponents, at (0,0). pg.dispose(); // release the first page to the print queue. pg = pj.getGraphics(); // get graphics object for second page. pg.drawLine( 0, 0, 100, 100 ); // draw directly onto the graphics object as if it were a Canvas. pg.dispose(); // release the second page to the print queue. pj.end(); // Finish off the print job, start printing.