/* Cancel PrinterJob jobs that haven't yet completed. */
public void cancel() throws PrintException {
synchronized (this) {
if (!printing) {
throw new PrintException("Job is not yet submitted.");
} else if (job != null && !printReturned) {
job.cancel();
notifyEvent(PrintJobEvent.JOB_CANCELED);
return;
} else {
throw new PrintException("Job could not be cancelled.");
}
}
}