From 486d720e0b341ddc4f9fecae0c8bc0e496c4a3f4 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Wed, 19 Feb 2014 20:17:25 +0000 Subject: [PATCH] * try fixing layout issues via auto-pack --- .../filebot/ui/rename/FormatDialog.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/source/net/sourceforge/filebot/ui/rename/FormatDialog.java b/source/net/sourceforge/filebot/ui/rename/FormatDialog.java index 8046a960..2e249afb 100644 --- a/source/net/sourceforge/filebot/ui/rename/FormatDialog.java +++ b/source/net/sourceforge/filebot/ui/rename/FormatDialog.java @@ -9,6 +9,7 @@ import static net.sourceforge.tuned.ui.TunedUtilities.*; import java.awt.Color; import java.awt.Component; import java.awt.Desktop; +import java.awt.Dimension; import java.awt.Font; import java.awt.Rectangle; import java.awt.Window; @@ -190,6 +191,21 @@ public class FormatDialog extends JDialog { pane.add(header, "h 60px, growx, dock north"); pane.add(content, "grow"); + addPropertyChangeListener("sample", new PropertyChangeListener() { + + @Override + public void propertyChange(PropertyChangeEvent evt) { + // set size after initial sample evaluations + invokeLater(400, new Runnable() { + + @Override + public void run() { + FormatDialog.this.pack(); + } + }); + } + }); + addPropertyChangeListener("sample", new PropertyChangeListener() { @Override @@ -226,7 +242,7 @@ public class FormatDialog extends JDialog { // initialize window properties setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); - setSize(650, 450); + setMinimumSize(new Dimension(650, 450)); // initialize data setState(initMode, lockOnBinding != null ? lockOnBinding : restoreSample(initMode), lockOnBinding != null);