public class Users { public List<Person> people = new ArrayList<Person>(); public List<Person> getPeople() { return people; } public void addPerson(Person person) { people.add(person); } }
public class Person { public String username =""; public String location =""; public Person(String name){ username = name; } public String getUsername() { return username; } }
actionPerformed(){ users.addPerson(new Person("Jim")); }
Looks to me like your addPerson() method isn't firing any property change event. Unless you do that, the JList and the Data Binding framework itself have no idea that you have added anything. I would recommend reviewing the JFace Data Binding docs as the framework imposes specific requirements on any domain objects that you use.
In general, questions about how to use the JFace Data Binding framework should be posted to the Eclipse JFace Forum.[/url]
public class Person extends ModelObject