This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes How to bind a JList to a Bean class property Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to bind a JList to a Bean class property" Watch "How to bind a JList to a Bean class property" New topic

How to bind a JList to a Bean class property

Dhanushka Nayanananda

Joined: Jan 16, 2011
Posts: 14

I tried to bind a JList to a Binding class property, Vector. In the binding class, the vector is updated when a JTextField in UI is updated.

public void setName(String name) {

String oldName =; = name;
Vector oldList=this.list;
propertySupport.firePropertyChange("name", oldName,;//textField updates
propertySupport.firePropertyChange(PROP_LIST, oldList, list); // JList}
Also another seperate setter is available for updating the Vector. I have set add/remove PropertyChangeListeners as well.

My real requirement is to update the JList according to data in BeanBinding class.(Ex. When user type in JTextField, relevant data from 1.database and 2.existing variables in class should be loaded into the JList)

Please,any one let me know how to bind data BeanBinding class(source) property for a JList in NetBeans.At least any tutorial link. There is a sample in NetBeans site,but it is for getting data directly from database.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: How to bind a JList to a Bean class property
It's not a secret anymore!