public NewTypePanelFunction(Type.Function t) {
   super();
   tf = t;
   checkParamName.addActionListener(new checkListener());
   checkResultName.addActionListener(new checkListener());
   northPanel.setBorder(BorderFactory.createEtchedBorder());
   checkBoxPanel.setBorder(BorderFactory.createEtchedBorder());
   setLayout(new BorderLayout());
   northPanel.setLayout(new GridLayout(2, 1));
   checkBoxPanel.setLayout(new GridLayout(2, 1));
   checkBoxPanel.add(checkParamName);
   checkBoxPanel.add(checkResultName);
   checkParamName.setSelected(tf.checkParamName);
   checkResultName.setSelected(tf.checkResultName);
   paramSelector =
       new TypeFieldSelector("Parameter Type:", "Select Parameter Type...", this, tf.param);
   resultSelector =
       new TypeFieldSelector("Result Type:", "Select Result Type...", this, tf.result);
   northPanel.add(paramSelector);
   northPanel.add(resultSelector);
   add(checkBoxPanel, BorderLayout.CENTER);
   add(northPanel, BorderLayout.NORTH);
 }
  private void setupEvents() {
    specifyUPB.addActionListener(specifyUPBListener);

    specifyLWB.addActionListener(specifyLWBListener);

    yesUPB.addChangeListener(
        new ChangeListener() {
          public void stateChanged(ChangeEvent e) {
            if (yesUPB.isSelected()) {
              specifyUPB.setVisible(true);
              UPBLabel.setVisible(specifyUPB.isSelected());
              UPBDetailPanel.setVisible(true);
            } else {
              if (yesCyclic.isSelected()) {
                specifyUPB.setVisible(true);
                yesUPB.setSelected(true);
                UPBDetailPanel.setVisible(true);
                UPBLabel.setVisible(specifyUPB.isSelected());
              } else {
                specifyUPB.setSelected(false);
                specifyUPB.setVisible(false);
                UPBLabel.setText("0");
                UPBLabel.setVisible(false);
                UPBDetailPanel.setVisible(false);
              }
            }
          }
        });

    yesLWB.addChangeListener(
        new ChangeListener() {
          public void stateChanged(ChangeEvent e) {
            if (yesLWB.isSelected()) {
              specifyLWB.setVisible(true);
              LWBLabel.setVisible(specifyLWB.isSelected());
              LWBDetailPanel.setVisible(true);
            } else {
              if (yesCyclic.isSelected()) {
                specifyLWB.setVisible(true);
                yesLWB.setSelected(true);
                LWBDetailPanel.setVisible(true);
                LWBLabel.setVisible(specifyLWB.isSelected());
              } else {
                specifyLWB.setSelected(false);
                specifyLWB.setVisible(false);
                LWBLabel.setText("0");
                LWBLabel.setVisible(false);
                LWBDetailPanel.setVisible(false);
              }
            }
          }
        });

    UPBLabel.addKeyListener(listener);

    LWBLabel.addKeyListener(listener);

    yesCyclic.addChangeListener(
        new ChangeListener() {
          public void stateChanged(ChangeEvent e) {
            if (yesCyclic.isSelected()) {
              specifyLWB.setVisible(true);
              yesLWB.setSelected(true);
              specifyUPB.setVisible(true);
              yesUPB.setSelected(true);
              LWBLabel.setVisible(specifyLWB.isSelected());
              UPBLabel.setVisible(specifyUPB.isSelected());
            }
          }
        });
  }