previous | start | next

## How can I get notified when the user has moved a `JSlider`?

- There is no `addActionListener` method
- There is a method
  `public void addChangeListener(ChangeListener l)`
- Click on the `ChangeListener` link to learn more
- It has a single method:
  `void stateChanged(ChangeEvent e)`
- Apparently, method is called whenever user moves the slider
- What is a `ChangeEvent`?
  - It inherits `getSource` method from superclass `EventObject`
  - `getSource`: tells us which component generated this event

previous | start | next