I'm working on Tab Pane on JavaFx, my problem is that i can't handle any KeyEvent inside the tab, such as F5 press or any key on the keyboard, also the function is working on any element inside the Tab like TextField
, my goal is to handle any event inside the Tab not elements.
This is my code that i tested it
tab.getContent().addEventFilter(KeyEvent.KEY_PRESSED, new EventHandler<KeyEvent>() {
@Override
public void handle(KeyEvent event) {
System.out.println("Filtering out event " + event.getCode());
event.consume();
}
});