Public Methods | |
PropertyPanel () | |
PropertyPanel (int vgap) | |
void | addPair (String name, JComponent c) |
void | addPair (String name, Component c) |
|
00021 { 00022 this(0); 00023 } |
|
00026 { 00027 setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); 00028 setBorder(BorderFactory.createEmptyBorder(10,10,10,10)); 00029 00030 _itemsPanel = new JPanel(new BorderLayout(20,5)); 00031 00032 _labelPanel = new JPanel(new GridLayout(0, 1, 0, vgap)); 00033 _fieldPanel = new JPanel(new GridLayout(0, 1, 0, vgap)); 00034 _itemsPanel.add(_labelPanel, BorderLayout.WEST); 00035 _itemsPanel.add(_fieldPanel, BorderLayout.CENTER); 00036 00037 add(_itemsPanel); 00038 add(Box.createVerticalGlue()); 00039 } |
|
00042 { 00043 addPair(name, (Component)c); 00044 } |
|
00047 { 00048 if(c == null) c = new JLabel(); 00049 00050 _labelPanel.add(new JLabel(name)); 00051 _fieldPanel.add(c); 00052 00053 Dimension d = _itemsPanel.getPreferredSize(); 00054 _itemsPanel.setMaximumSize(new Dimension(Short.MAX_VALUE, d.height)); 00055 } |