X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fnet%2Fpterodactylus%2Futil%2Fswing%2FStatusBar.java;h=1e1873e1f515f4384cf939c59908f36eafb1535f;hb=c63257e8cc0ba1a5aca9364b22171abe7279d479;hp=f4dc1464fa5f356aadb3c508112d5f85b40d93ed;hpb=dd8b4361efb9d53fccaf52584ca684d84f54204a;p=jSite2.git diff --git a/src/net/pterodactylus/util/swing/StatusBar.java b/src/net/pterodactylus/util/swing/StatusBar.java index f4dc146..1e1873e 100644 --- a/src/net/pterodactylus/util/swing/StatusBar.java +++ b/src/net/pterodactylus/util/swing/StatusBar.java @@ -35,9 +35,8 @@ import javax.swing.border.EtchedBorder; /** * Status bar component that can be added to the {@link BorderLayout#SOUTH} area * of a {@link JFrame}’s {@link JFrame#getContentPane() content pane}. - * + * * @author David ‘Bombe’ Roden <bombe@freenetproject.org> - * @version $Id$ */ /* TODO - make it possible to add further components. */ public class StatusBar extends JPanel { @@ -62,7 +61,7 @@ public class StatusBar extends JPanel { /** * Sets the text of the label. - * + * * @param text * The text of the label */ @@ -73,7 +72,7 @@ public class StatusBar extends JPanel { /** * Adds a side component to the right side of the status bar, pushing all * previously added side components to the left. - * + * * @param component * The component to add */ @@ -81,11 +80,12 @@ 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(); } /** * Returns the number of side components. - * + * * @return The number of side components */ public int getSideComponentCount() { @@ -94,7 +94,7 @@ public class StatusBar extends JPanel { /** * Returns all side components in order. - * + * * @return All side components */ public List getSideComponents() { @@ -103,24 +103,26 @@ public class StatusBar extends JPanel { /** * Removes the side component with the given index. - * + * * @param sideComponentIndex * The index of the side component to remove */ public void removeSideComponent(int sideComponentIndex) { Component sideComponent = sideComponents.remove(sideComponentIndex); remove(sideComponent); + validate(); } /** * Removes the given side component. - * + * * @param sideComponent * The side component to remove */ public void removeSideComponent(Component sideComponent) { sideComponents.remove(sideComponent); remove(sideComponent); + validate(); } }