mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-27 15:03:21 -04:00
optimized the layout of the DataEditor
This commit is contained in:
parent
f72e5dac4b
commit
5a27cf916f
@ -50,6 +50,7 @@ public class DataEditor extends JDialog {
|
||||
table.setDefaultRenderer(MyLong.class, new MyLongRenderer(bits));
|
||||
getContentPane().add(new JScrollPane(table));
|
||||
|
||||
int minWidth = 0;
|
||||
if (modelIsRunning) {
|
||||
dataField.addListener(dm);
|
||||
addWindowListener(new WindowAdapter() {
|
||||
@ -75,9 +76,10 @@ public class DataEditor extends JDialog {
|
||||
}
|
||||
}));
|
||||
getContentPane().add(buttons, BorderLayout.SOUTH);
|
||||
minWidth = buttons.getPreferredSize().width;
|
||||
}
|
||||
|
||||
setPreferredSize(new Dimension((cols + 1) * 50, getPreferredSize().height));
|
||||
setPreferredSize(new Dimension(Math.max((cols + 1) * 50, minWidth + 10), getPreferredSize().height));
|
||||
|
||||
pack();
|
||||
|
||||
@ -175,7 +177,7 @@ public class DataEditor extends JDialog {
|
||||
|
||||
@Override
|
||||
public void valueChanged(int addr) {
|
||||
if (addr<0) {
|
||||
if (addr < 0) {
|
||||
// all values have changed!
|
||||
fireEvent(new TableModelEvent(this));
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user