Swing Databinding for multiple JComponents
I'm pretty new to JAVA. I'm having a domain-model (containing the data) and I have a viewer-model (providing the GUI). Now I have several JLabels (or any other JComponents) on different windows, being bound to the same data-source in the domain-model.
I tried using beansbinding, but unfortunatly beansbind开发者_开发技巧ing seems not to support the binding of several widgets on a single source - only one widget is updated, the others are left untouched.
JGoodies is not possible for me, due to license questions.
Does anyone know another (free) Databinding-Project for SWING?
Thanks in advance Joan
Have a look to the Client Editor sample application provided with NetBeans (New Project -> Samples / Java / Client Editor)
- Open the main frame: ClientEditor.java
- Add a label somewhere (in the corner bottom left for example)
- Change its Binding (in Properties window) and use the same "formula" as the
usernameLabel
(at the right of "Client Info:") which is:Form[${client.firstName} ${client.surname}]
Result:
精彩评论