From e34a4c5332c2d4d92651e0adc99ab7c5d262d13b Mon Sep 17 00:00:00 2001 From: gmungoc Date: Tue, 24 Apr 2018 15:27:36 +0100 Subject: [PATCH] JAL-2959 no Print dialog shown if Page Format is Cancelled --- src/jalview/gui/PCAPanel.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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); -- 1.7.10.2