예제 #1
0
    /**
     * Utility method to add components to dialog list
     *
     * @param comps list to add to
     * @param name name
     * @param cbx enable checkbox
     * @param comp the component
     */
    private void addEditComponents(
        List comps, String name, final JCheckBox cbx, final JComponent comp) {
      cbx.addChangeListener(
          new ChangeListener() {
            public void stateChanged(ChangeEvent e) {
              GuiUtils.enableTree(comp, cbx.isSelected());
            }
          });

      GuiUtils.enableTree(comp, cbx.isSelected());
      comps.add(GuiUtils.top(GuiUtils.inset(cbx, 5)));
      comps.add(GuiUtils.top(GuiUtils.inset(GuiUtils.rLabel(name), new Insets(8, 0, 0, 0))));
      JComponent right = GuiUtils.inset(comp, new Insets(3, 5, 0, 0));
      //            comps.add(GuiUtils.leftCenter(GuiUtils.top(GuiUtils.inset(cbx,
      //                    new Insets(2, 0, 0, 0))), GuiUtils.topLeft(right)));
      comps.add(GuiUtils.topLeft(right));
    }