Reputation: 1
I'm new in SwingBindings.
I have a list of beans named Project each Project has an reference to another bean named Config. Each Config has 2 attributes, how can I bind with swingbindings those two attributes of the bean Config to components form a jframe?
the list of projects is bound to a combobox. When I change the selected item from combobox(of project) I want to refresh the values from the object config associated to the current selected project in the form.
Upvotes: 0
Views: 156
Reputation: 59650
Try this:
ListCellRenderer
. comboBox.setRenderer(...)
)getListCellRendererComponent(.....)
mehod cast value
(Second argument) to Project and return appropriate value that you want to display in comboBox. (Might be project's name/title)ItemListener
) and in its action method get selected object of comboBox, which will be your Project object.Upvotes: 2