• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to bind a JList to a Bean class property

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi...

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 = this.name;
this.name = name;
Vector oldList=this.list;
list.add(name);
propertySupport.firePropertyChange("name", oldName, this.name);//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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic