The JavaFX API is really complete and sometimes I find new possibilities with it. This is a small blog post to describe what I recently did with the event handling part of the JavaFX API. Update: Jonathan Giles pointed that we can add a handler to all kind of events with one single line instead call setOn* multiple times: lbl.addEventHandler( MouseEvent.ANY, eventHandler) One handler to all Events I'm creating a sample application for my portuguese blog about JavaFX basics and I was exploring the Event class to find the best way to create an event handler to demonstrate all Node's possible event input handlers.(or the most famous one) I found that the event object has an attribute of type EventType and all the events implementations contains a String representation of that event. It can be done checking, for example, the MouseEvent class source code. With this I created only one class to handle all the events on my sample program. I think it might be useful...
Blog about programming, client applications and intelligent use of AI. Talking about Machine Learning and AI before it was cool! We like to use JavaFX, Processing, Local execution of ML and LLM models and everything that is fun!