I have this Swing application I'm working on, it has a pair of JSliders and JTextFields that display and control the value of two numbers. Right now, I kind of hacked everything together to make it work, intercept change events and update the display. However, I think the best way is to make a model with two numbers and somehow connect this model with my GUI. I know how to make a model, but how would I lose the way I could relate this to my GUI ... any suggestions?
update: my model is ready + includes changes in firing properties. I think I would like to use some kind of data binding approach (like JGoodies Binding), but I'm not sure how ... JGoodies Binding does not support sliders.
edit: also note when the slider changes position, the text field should change its value; when the text field changes the value, the slider should change the position; and when the model changes value, how the text box + slider should be updated.

source
share