Commits

beholdmyglory committed 0ec8e00

Small adjustment to status bar

Comments (0)

Files changed (1)

src/se/kth/csc/inda11/remains/gui/Statusbar.java

 import java.awt.FlowLayout;
 import java.awt.Point;
 
+import javax.swing.Box;
 import javax.swing.BoxLayout;
 import javax.swing.JLabel;
 import javax.swing.JPanel;
         
         class LabelPanel extends JPanel {
             private static final long serialVersionUID = -7227185425047327703L;
+            private int width;
 
             public LabelPanel(JLabel label, int width) {
+                this.width = width;
                 this.setMaximumSize(new Dimension(width, 100));
                 this.setMinimumSize(new Dimension(width, 0));
                 this.setLayout(new FlowLayout(FlowLayout.LEFT));
                 this.add(label);
             }
+            
+            @Override
+            public Dimension getPreferredSize() {
+                return new Dimension(this.width, super.getPreferredSize().height);
+            }
         }
 
-        this.add(new LabelPanel(this.generationLabel = new JLabel("Generation: 0"), 250));
+        this.add(this.generationLabel = new JLabel("Generation: 0"));
+        this.add(Box.createGlue());
+        this.add(new LabelPanel(this.xyLabel = new JLabel("x: 0 ; y: 0"), 200));
         this.add(new LabelPanel(this.speedLabel = new JLabel("Speed: 5 gen/s"), 150));
-        this.add(this.xyLabel = new JLabel("x: 0 ; y: 0"));
     }
     
     public void setGeneration(long generation) {