When I print out the information on the jTable, it only prints about two and a half Columns of the seven column jTable.
Here is a copy of the code that prints the table:
public class printprogram implements Printable, ActionListener {
public int print(Graphics g, PageFormat pf, int page) throws
PrinterException {
if (page > 0) {
return NO_SUCH_PAGE;
}
Graphics2D g2d = (Graphics2D) g;
g2d.translate(pf.getImageableX(), pf.getImageableY());
//g.drawString(formated, 100, 100);
table.printAll(g);
return PAGE_EXISTS;
}
public void actionPerformed(ActionEvent e) {
PrinterJob job = PrinterJob.getPrinterJob();
job.setPrintable(this);
boolean ok = job.printDialog();
if (ok) {
try {
job.print();
} catch (PrinterException ex) {
}
}
}
}
Out of seven columns, this is what prints out:
Does anybody know why it isn't printing the full table? Thanks for the help in advance.