diff --git a/src/main/java/net/rptools/maptool/client/swing/GenericDialog.java b/src/main/java/net/rptools/maptool/client/swing/GenericDialog.java index e5af1f7b74..48543bf1d2 100644 --- a/src/main/java/net/rptools/maptool/client/swing/GenericDialog.java +++ b/src/main/java/net/rptools/maptool/client/swing/GenericDialog.java @@ -43,6 +43,14 @@ public GenericDialog(String title, Frame parent, JPanel panel, boolean modal) { setLayout(new GridLayout()); JScrollPane scrollPane = new JScrollPane(this.panel); add(scrollPane); + + addWindowListener( + new WindowAdapter() { + @Override + public void windowClosing(WindowEvent e) { + closeDialog(); + } + }); addComponentListener( new ComponentAdapter() { private void placeButtons() {