* try fixing layout issues via auto-pack

This commit is contained in:
Reinhard Pointner 2014-02-19 20:17:25 +00:00
parent 8f647622f0
commit 486d720e0b
1 changed files with 17 additions and 1 deletions

View File

@ -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);