UI tweaks
authorNiki Roo <niki@nikiroo.be>
Mon, 4 May 2020 21:42:13 +0000 (23:42 +0200)
committerNiki Roo <niki@nikiroo.be>
Mon, 4 May 2020 21:42:13 +0000 (23:42 +0200)
ui/NavBar.java

index eb4ba4faaad1a95abf4165cf12c9b582d67fc8d8..e99115c329ede86d6cd7919618d6b0346134d39e 100644 (file)
@@ -80,7 +80,10 @@ public class NavBar extends ListenerPanel {
                });
 
                page = new JTextField(Integer.toString(min));
-               page.setPreferredSize(new Dimension(page.getPreferredSize().width * 2,
+               page.setPreferredSize(
+                               new Dimension(new JButton("1234").getPreferredSize().width,
+                                               new JButton("dummy").getPreferredSize().height));
+               page.setMaximumSize(new Dimension(Integer.MAX_VALUE,
                                page.getPreferredSize().height));
                page.addActionListener(new ActionListener() {
                        @Override
@@ -99,7 +102,7 @@ public class NavBar extends ListenerPanel {
                        }
                });
 
-               maxPage = new JLabel(" of " + max + " ");
+               maxPage = new JLabel("of " + max);
 
                next = new JButton();
                next.addActionListener(new ActionListener() {
@@ -122,13 +125,15 @@ public class NavBar extends ListenerPanel {
 
                this.add(first);
                this.add(previous);
+               this.add(new JLabel(" "));
                this.add(page);
+               this.add(new JLabel(" "));
                this.add(maxPage);
+               this.add(new JLabel(" "));
                this.add(next);
                this.add(last);
 
-               label = new JLabel("");
-               this.add(label);
+               this.add(label = new JLabel(""));
 
                this.min = min;
                this.max = max;
@@ -234,7 +239,7 @@ public class NavBar extends ListenerPanel {
                        index = max;
                }
 
-               maxPage.setText(" of " + max + " ");
+               maxPage.setText("of " + max);
                updateEnabled();
                updateLabel();
        }