From: gmungoc Date: Thu, 23 Mar 2017 15:10:52 +0000 (+0000) Subject: JAL-2464 fix cancel tree print behaviour X-Git-Tag: Release_2_10_2~3^2~141^2^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=844c332f108aba635608f13dedf2b08777b3a477;p=jalview.git JAL-2464 fix cancel tree print behaviour --- diff --git a/src/jalview/gui/TreeCanvas.java b/src/jalview/gui/TreeCanvas.java index 54eed1a..9a38d4c 100755 --- a/src/jalview/gui/TreeCanvas.java +++ b/src/jalview/gui/TreeCanvas.java @@ -549,7 +549,16 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable, 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);