0 Replies Latest reply on May 2, 2009 5:03 PM by user12076936

    to hide JSpinner with a checbox?

           private SpinnerNumberModel alarmIntervals = new SpinnerNumberModel(DEF_TIME_ALARM, DEF_TIME_ALARM, DEF_TIME_ALARM*QUARTERS_DAY, DEF_TIME_ALARM);
           private JSpinner alarmIntervalSelector;
      private JCheckBox alarmOption;
                alarmOption = new JCheckBox(ALARM);
                alarmIntervalSelector = new JSpinner(alarmIntervals);
           public void itemStateChanged(ItemEvent selectedItem){
                              if (selectedItem.getSource() == alarmOption){
                          if (selectedItem.getStateChange() == ItemEvent.SELECTED){
                          alarmIntervalSelector.setVisible(true); frame.pack();
                           } else if (selectedItem.getStateChange() == ItemEvent.DESELECTED){
                          alarmIntervalSelector.setVisible(false); // should disable alarm?
      These are snippets of the code that seem not to work. Basically I'm trying to hide a component (JSpinner) until the checbox is selected, and vice versa. Yet in the implementation clicking on the checkbox does nothing (should display the jspinner).