Just want to do a simple print screen from java application from menu item/toolbar button. Have following action listener which brings up the print dialog box, but does not print the screen, just a kernel error:

public void actionPerformed(ActionEvent e) {
PrinterJob job = PrinterJob.getPrinterJob();
if (job.printDialog()) {
try {
job.print();
} catch (Exception prt) {
System.err.println(prt.getMessage());
}
}
}