Error using a ChangeListener for JSlider

The code...

class SliderListenerimplements ChangeListener{

publicvoid stateChanged(ChangeEvent e){

JSlider source = (JSlider)e.getSource();

if (!source.getValueIsAdjusting()){

int doc = (int)source.getValue();

}

}

}

docSlider.addChangeListener(new SliderListenerChangeListener());

The errors...

init:

deps-jar:

Compiling 1 source file to C:\Documents and Settings\James Kovacs\OCR\build\classes

C:\Documents and Settings\James Kovacs\OCR\src\App.java:41: <identifier> expected

docSlider.addChangeListener(new SliderListenerChangeListener());

C:\Documents and Settings\James Kovacs\OCR\src\App.java:41: illegal start of type

docSlider.addChangeListener(new SliderListenerChangeListener());

2 errors

BUILD FAILED (total time: 0 seconds)

[1352 byte] By [jdk2006a] at [2007-11-27 5:09:34]
# 1
More code is needed for context. It appears that that last line is in fact just hanging limpy by itself in your code, thus the compiler whining.
cotton.ma at 2007-7-12 10:29:23 > top of Java-index,Java Essentials,Java Programming...
# 2
Magic: try this -- note initial semicolon.;docSlider.addChangeListener(new SliderListenerChangeListener();
Hippolytea at 2007-7-12 10:29:23 > top of Java-index,Java Essentials,Java Programming...