Пример #1
0
  /**
   * This constructor must be used to initialize the bean.
   *
   * @param listBean
   */
  public SurveyPointListPanel(SurveyPointListBean listBean) {
    this.theBean = listBean;
    initComponents();
    this.txtAcceptableShift.setText(
        optionRural.isSelected()
            ? this.getAcceptanceShift(true).toString()
            : this.getAcceptanceShift(false).toString());

    // Add a listner to the bean property of selected bean
    theBean.addPropertyChangeListener(
        new PropertyChangeListener() {
          @Override
          public void propertyChange(PropertyChangeEvent evt) {
            if (evt.getPropertyName().equals(AbstractListSpatialBean.SELECTED_BEAN_PROPERTY)) {
              customizeButtons((SpatialBean) evt.getNewValue());
            }
          }
        });
  }