revalidate status bar if side components changed
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 25 May 2008 10:37:52 +0000 (12:37 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 25 May 2008 10:37:52 +0000 (12:37 +0200)
src/net/pterodactylus/util/swing/StatusBar.java

index f4dc146..f37b9d7 100644 (file)
@@ -81,6 +81,7 @@ public class StatusBar extends JPanel {
                sideComponents.add(component);
                int newIndex = sideComponents.size();
                add(component, new GridBagConstraints(newIndex, 0, 1, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(0, 2, 0, 0), 0, 0));
+               validate();
        }
 
        /**
@@ -110,6 +111,7 @@ public class StatusBar extends JPanel {
        public void removeSideComponent(int sideComponentIndex) {
                Component sideComponent = sideComponents.remove(sideComponentIndex);
                remove(sideComponent);
+               validate();
        }
 
        /**
@@ -121,6 +123,7 @@ public class StatusBar extends JPanel {
        public void removeSideComponent(Component sideComponent) {
                sideComponents.remove(sideComponent);
                remove(sideComponent);
+               validate();
        }
 
 }