]> code.citadel.org Git - citadel.git/commitdiff
'cuz I'm lazy and just want to do it once
authorChilly <chilly@uncensored.citadel.org>
Thu, 29 Jul 1999 17:19:27 +0000 (17:19 +0000)
committerChilly <chilly@uncensored.citadel.org>
Thu, 29 Jul 1999 17:19:27 +0000 (17:19 +0000)
shaggy/VertPanel.java [new file with mode: 0644]

diff --git a/shaggy/VertPanel.java b/shaggy/VertPanel.java
new file mode 100644 (file)
index 0000000..8b1f0f1
--- /dev/null
@@ -0,0 +1,28 @@
+import java.awt.*;
+
+public class VertPanel extends Panel {
+  GridBagLayout                gbLayout;
+  GridBagConstraints   cur;
+  boolean              top = true;
+
+  public VertPanel() {
+    setLayout( gbLayout = new GridBagLayout() );
+
+    cur = new GridBagConstraints();
+    cur.fill = GridBagConstraints.BOTH;
+    cur.gridwidth = GridBagConstraints.REMAINDER;
+    cur.ipadx = 0;
+    cur.ipady = 0;
+    cur.anchor = GridBagConstraints.NORTH;
+  }
+
+  public Component add( Component c ) {
+    if( top ) {
+      cur.weighty = 1;
+      top = false;
+    } 
+
+    gbLayout.setConstraints( c, cur );
+    return super.add( c );
+  }
+}