slider.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { spinner.setValue(slider.getValue()); }});spinner.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { slider.setValue((Integer)spinner.getValue()); }});
slider.valueChanged.connect(spinBox, "setValue(int)");spinBox.valueChanged.connect(slider, "setValue(int)");