KickJava   Java API By Example, From Geeks To Geeks.

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


1 package org.objectweb.proactive.p2p.peerconfiguration;
2 import javax.swing.*;
3 import javax.swing.event.*;
4
5
6 public class SliderValueUpdate implements ChangeListener {
7
8 protected JSlider j=null;
9 protected JTextField t=null;
10
11  public SliderValueUpdate(JSlider j, JTextField t) {
12      this.j=j;
13      this.t=t;
14  }
15
16 public void stateChanged(ChangeEvent e) {
17      Integer JavaDoc CPULoad = new Integer JavaDoc(j.getValue());
18      t.setText(CPULoad.toString() + "%");
19  }
20
21 }
Popular Tags