printing a 2 pages of jframe in java
问题 i would like to print a jframe that contain a lot of textfield and buttons that contain a data. i want to print this jframe by clicking a Print jbutton. i tried this code. protected void print() { PrinterJob job = PrinterJob.getPrinterJob(); if(job.printDialog()){ try { job.setPrintable(new Printable() { @Override public int print(Graphics graphics, PageFormat pageFormat, int pageIndex) throws PrinterException { if(pageIndex == 0){ Graphics2D g2d = (Graphics2D)graphics; g2d.translate