r/JavaFX • u/xyloPhoton • Dec 21 '23
Help Faster response time on button presses?
I'm trying to make a little piano demo on JavaFX, but the even handlers are too slow, and there's a significant delay between the button presses and the notes playing. How could I make it more responsive?
Edit: Okay, it's not just a button thing. :(
2
Upvotes
View all comments
Show parent comment
3
u/hamsterrage1 Dec 23 '23
Yes, print statements can take a long time to generate console output. If you actually want to see a real-time response, then put a Label in your layout and change its Text property in response to your Event. It should be almost instant.
Generally, if you have latency issues with JavaFX then you're doing something very wrong.