Java tutorial
import javax.swing.DefaultBoundedRangeModel; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; public class Main { public static void main(String args[]) { DefaultBoundedRangeModel model = new DefaultBoundedRangeModel(); ChangeListener myListener = new MyChangeListener(); model.addChangeListener(myListener); ChangeListener[] lis = model.getChangeListeners(); } } class MyChangeListener implements ChangeListener { public void stateChanged(ChangeEvent e) { System.out.println("A ChangeEvent has been fired!"); } }