An EventHandler can be attached to a tab via Tab.setOnClosed(EventHandler)
When the close event is fired the handler receives as source a tab which Tab.getTabPane() method returns null instead of the TabPane the Tab is attached to. Of course after the close handling null could be an expected result, but not at notification time.
public void handle(final Event event) {
System.out.println(((Tab)event.getSource).getTabPane());
}
Displays "null"!
When the close event is fired the handler receives as source a tab which Tab.getTabPane() method returns null instead of the TabPane the Tab is attached to. Of course after the close handling null could be an expected result, but not at notification time.
public void handle(final Event event) {
System.out.println(((Tab)event.getSource).getTabPane());
}
Displays "null"!