jchmb / fxutils

JavaFX Utils

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JavaFX Utils Library

Code Samples

ListBinder

final Group group = new Group();
final ListProperty<Person> listProperty = ...; // Some list property with Person objects
final ListBinder<Person, Node> binder = ListBinder.nodeListBinder(
	listProperty,
	group.getChildren(),
	person -> new Label(person.getName())
);

// Changing the Person's name property now triggers a change in the list.
binder.addPropertyGetter(Person::nameProperty);

// Do the actual binding to finish things up.
binder.bind();

About

JavaFX Utils


Languages

Language:Java 100.0%