private Label valueLabel2 = null;
@Override
public void startup(Display display, Map<String, String> properties)
throws Exception {
BXMLSerializer bxmlSerializer = new BXMLSerializer();
window = new Window((Component)bxmlSerializer.readObject(getClass().getResource("slider_test.bxml")));
slider1 = (Slider)bxmlSerializer.getNamespace().get("slider1");
slider1.getSliderValueListeners().add(new SliderValueListener() {
@Override
public void valueChanged(Slider slider, int previousValue) {
valueLabel1.setText(Integer.toString(slider.getValue()));
}
});
slider2 = (Slider)bxmlSerializer.getNamespace().get("slider2");
slider2.getSliderValueListeners().add(new SliderValueListener() {
@Override
public void valueChanged(Slider slider, int previousValue) {
valueLabel2.setText(Integer.toString(slider.getValue()));
}
});
valueLabel1 = (Label)bxmlSerializer.getNamespace().get("valueLabel1");
valueLabel2 = (Label)bxmlSerializer.getNamespace().get("valueLabel2");
window.setTitle("Slider Test");
window.setMaximized(true);
window.open(display);
}