From 20b3748df6def0751477cc52dcb80062401c9c44 Mon Sep 17 00:00:00 2001 From: SiboVG Date: Thu, 1 Dec 2022 19:21:32 +0100 Subject: [PATCH] Close PhotoStudio when parent window closes --- .../net/sf/openrocket/gui/figure3d/photo/PhotoFrame.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/swing/src/net/sf/openrocket/gui/figure3d/photo/PhotoFrame.java b/swing/src/net/sf/openrocket/gui/figure3d/photo/PhotoFrame.java index 3ce2cd3cc..c495a1db5 100644 --- a/swing/src/net/sf/openrocket/gui/figure3d/photo/PhotoFrame.java +++ b/swing/src/net/sf/openrocket/gui/figure3d/photo/PhotoFrame.java @@ -69,6 +69,14 @@ public class PhotoFrame extends JFrame { public PhotoFrame(OpenRocketDocument document, Window parent) { this(false, document); setTitle(trans.get("PhotoFrame.title") + " - " + document.getRocket().getName()); + + // Close this window when the parent is closed + parent.addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent e) { + dispose(); + } + }); } public PhotoFrame(boolean app, OpenRocketDocument document) {