]> code.citadel.org Git - citadel.git/blob - shaggy/VertPanel.java
Clarify that we are GPLv2
[citadel.git] / shaggy / VertPanel.java
1 import javax.swing.*;
2 import java.awt.*;
3
4 public class VertPanel extends JPanel {
5   GridBagLayout         gbLayout;
6   GridBagConstraints    cur;
7   boolean               top = true;
8
9   public VertPanel() {
10     setLayout( gbLayout = new GridBagLayout() );
11
12     cur = new GridBagConstraints();
13     cur.fill = GridBagConstraints.BOTH;
14     cur.gridwidth = GridBagConstraints.REMAINDER;
15     cur.ipadx = 0;
16     cur.ipady = 0;
17     cur.anchor = GridBagConstraints.NORTH;
18   }
19
20   public Component add( Component c ) {
21     if( top ) {
22       cur.weighty = 1;
23       top = false;
24     } 
25
26     gbLayout.setConstraints( c, cur );
27     return super.add( c );
28   }
29 }