From: gmungoc Date: Tue, 24 Apr 2018 14:27:36 +0000 (+0100) Subject: JAL-2959 no Print dialog shown if Page Format is Cancelled X-Git-Tag: Release_2_11_0~43 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=e34a4c5332c2d4d92651e0adc99ab7c5d262d13b;p=jalview.git JAL-2959 no Print dialog shown if Page Format is Cancelled --- diff --git a/src/jalview/gui/PCAPanel.java b/src/jalview/gui/PCAPanel.java index 9f52d26..7ceceee 100644 --- a/src/jalview/gui/PCAPanel.java +++ b/src/jalview/gui/PCAPanel.java @@ -464,7 +464,16 @@ public class PCAPanel extends GPCAPanel public void run() { PrinterJob printJob = PrinterJob.getPrinterJob(); - PageFormat pf = printJob.pageDialog(printJob.defaultPage()); + PageFormat defaultPage = printJob.defaultPage(); + PageFormat pf = printJob.pageDialog(defaultPage); + + if (defaultPage == pf) + { + /* + * user cancelled + */ + return; + } printJob.setPrintable(this, pf);