don't know about Netbeans, just know that it uses a version of Beansbinding, so the following certainly can applied somehow
The whole idea of using a binding framework is that you never directly talk to the view, but fully concentrate on your model (or bean): some property of such a model is bound to a property of a view and your code only listens to changes in the the properties of your bean. "SelectedElement" is an artificial property of the binding (actually, of the JTableAdapterProvider, but that's nothing you need to know :-), so bind your model property to that - here's a snippet of doing so manually:
// model/bean
public class AlbumManagerModel .. {
// properties
ObservableList<Album> albums;
Album selectedAlbum;
// vents the list of elements
ObservableList<Album> getManagedAlbums() {
return albums;
}
// getter/setter
public Album getSelectedAlbum() {
return selectedAlbum;
}
public void setSelectedAlbum(Album album) {
Album old = getSelectedAlbum();
this.selectedAlbum = album;
firePropertyChange("selectedAlbum", old, getSelectedAlbum());
}
}
// bind the manager to a JTable
BindingGroup context = new BindingGroup();
// bind list selected element and elements to albumManagerModel
JTableBinding tableBinding = SwingBindings.createJTableBinding(
UpdateStrategy.READ,
albumManagerModel.getManagedAlbums(), albumTable);
context.addBinding(tableBinding);
// bind selection
context.addBinding(Bindings.createAutoBinding(UpdateStrategy.READ_WRITE,
albumManagerModel, BeanProperty.create("selectedAlbum"),
albumTable, BeanProperty.create("selectedElement_IGNORE_ADJUSTING")
));
// bind columns
tableBinding.addColumnBinding(BeanProperty.create("artist"));
...
context.bind();