PropertiesFrame: dispose on close
authorNiki Roo <niki@nikiroo.be>
Mon, 4 May 2020 17:21:51 +0000 (19:21 +0200)
committerNiki Roo <niki@nikiroo.be>
Mon, 4 May 2020 17:21:51 +0000 (19:21 +0200)
src/be/nikiroo/fanfix_swing/gui/PropertiesFrame.java

index fe67d513d41383c1d6ed9d9d70a7bf7db922109d..2e59e921ef8c393443a683d66e65d76ab95266da 100644 (file)
@@ -34,16 +34,16 @@ public class PropertiesFrame extends JDialog {
         */
        public PropertiesFrame(BasicLibrary lib, MetaData meta,
                        boolean undecorated) {
-               setTitle(MainFrame.trans(StringIdGui.TITLE_STORY, meta.getLuid(),
+               this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
+               this.setUndecorated(undecorated);
+               this.setLayout(new BorderLayout());
+               this.setTitle(MainFrame.trans(StringIdGui.TITLE_STORY, meta.getLuid(),
                                meta.getTitle()));
 
                desc = new PropertiesPanel(lib, meta, undecorated);
-               setLayout(new BorderLayout());
-               add(desc, BorderLayout.NORTH);
-
-               this.setUndecorated(undecorated);
+               this.add(desc, BorderLayout.NORTH);
 
-               pack();
+               this.pack();
                this.setSize(600, getHeight());
 
                if (!undecorated) {