KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > proactive > p2p > peerconfiguration > validityCheckCangeListener


1 package org.objectweb.proactive.p2p.peerconfiguration;
2 import javax.swing.*;
3 import javax.swing.event.*;
4
5
6 public class validityCheckCangeListener implements ChangeListener {
7
8        protected JSpinner[] sp = null;
9        protected boolean selected = false;
10
11        public validityCheckCangeListener(JSpinner[] sp) {
12               this.sp = sp;
13        }
14
15        public void stateChanged(ChangeEvent e) {
16               if (sp!=null) {
17                   if (!selected) {
18                      for (int i=0; i<sp.length; i++) {
19                          sp[i].setEnabled(false);
20                      }
21                      selected=true;
22                   } else {
23                      for (int i=0; i<sp.length; i++) {
24                          sp[i].setEnabled(true);
25                      }
26                      selected=false;
27                   }
28               }
29        }
30
31 }
Popular Tags