print two tables
<p>I'm trying to print a jpanel that contains two tables , but the problem that the width of the tables is larger than tha page which tables appear on. Is there away to make tables fit with page width , or should i sesize the tables themselves ?? </p>

<p>here is what i did :</p>

<pre><code> PrinterJob job = PrinterJob.getPrinterJob();
 job.setJobName("test");

 job.setPrintable (new Printable() {    
        @Override
    public int print(Graphics pg, PageFormat pf, int pageNum) throws PrinterException{
        if (pageNum &gt; 0){
        return Printable.NO_SUCH_PAGE;
        }


        Graphics2D g2 = (Graphics2D) pg;
        g2.translate(pf.getImageableX(), pf.getImageableY());
        jPanel1.print(g2);

         // jTable1.print(JTable.PrintMode.FIT_WIDTH, null, null);
        return Printable.PAGE_EXISTS;
    }
 });
 boolean ok = job.printDialog();
 if (ok) {
     try {
          job.print();
     } catch (PrinterException ex) {

     }
 }
</code></pre>
