Answer the question
In order to leave comments, you need to log in
How to work with GUI in one thread?
I'm using global keyboard capture. I can not start from the thread, the simplest, changing the text on the button.
@Override
public void nativeKeyReleased(NativeKeyEvent nativeKeyEvent) {
Platform.runLater( () -> {
if(nativeKeyEvent.getKeyCode() == NativeKeyEvent.VC_F2){
//161
Platform.runLater( () -> b_OpenNew.setText("2"));
}
});
}
Answer the question
In order to leave comments, you need to log in
First, look at what exactly you have null. There are 2 options, either this is nativeKeyEvent, or b_OpenNew
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question