I have list of stackPanes on which different fxmls are loaded. So i want to know which of the stackPane is in interactive with user. For example, if a event occurs on a fxml, then stackPane should be notified abt this event. I added mouse click event to the stackPane, but its not triggering everytime.
stackPane.setOnMouseClicked( new EventHandler<MouseEvent>(){
@Override
public void handle( MouseEvent event ){
setSelectedPane( (Pane) event.getSource() );
}
} );