Skip to content

A simple exercise in trying to understand the events generated by a JavaFX button

License

Notifications You must be signed in to change notification settings

dtonhofer/javafx_button_exercise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

javafx_button_exercise

A simple exercise in trying to understand the sequence of events generated by a JavaFX button.

I posted the question

JavaFX events sent to a button control: why two MOUSE_ENTERED / MOUSE_EXITED events?

to Stack Overflow, and after clarification, we get the code and diagrams in this project.

The program creates a Button Control which you can prod.

Button Control statechart

Information about events generated by the Button Control (aka. "received at the Button Control's event handlers) is then printed out.

See the MouseEvent JavaDoc for a description of events.

After testing a bit, we obtain the following (not quite formally correct) statechart that describes what events are generated. The statechart is large-ish because the sequence of event generated depends on where exactly the mouse button was pressed - outside the Button Control, inside the Button Control or inside the Button Control's label. (But there may well be a simpler statechart.)

Button Control statechart

The above has been edited in yEd, which has no notion about statechart semantics. The result is a graphml file.

About

A simple exercise in trying to understand the events generated by a JavaFX button

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages