Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.6.3
-
None
Description
JSlider supports synthetic binding for the value property, JSpinner should get a similar treatment. This should work (but doesn't in 1.6.3)
import groovy.swing.SwingBuilder import groovy.beans.Bindable @Bindable class Model { int intField } sb = new SwingBuilder() model = new Model() sb.frame(pack:true, show:true, defaultCloseOperation:javax.swing.JFrame.DISPOSE_ON_CLOSE) { vbox { hbox { label('Source Spinner:') spinner(value: bind(target:model, 'intField', value:50)) } hbox { label('Target Spinner:') spinner(value: bind(source:model, 'intField')) } } }