This commit is contained in:
Jonas Hinterdorfer 2025-04-23 19:05:38 +02:00
parent 72d87a894e
commit 46c0e9d760

View File

@ -29,6 +29,17 @@ public class AddressBookController {
contacts.addListener((ListChangeListener<? super Contact>) (observable) -> updateContactCount());
updateContactCount();
contactView.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> {
if (newValue != null) {
idField.setText(String.valueOf(newValue.getId()));
nameField.setText(newValue.getName());
phoneField.setText(newValue.getPhone());
emailField.setText(newValue.getEmail());
} else {
clearInputFields();
}
});
}
private Predicate<Contact> createFilterPredicate(String searchText) {