Accessibility is a prime concern for software nowadays. Various countries and organizations have passed accessibility laws (e.g. section 508) or guidelines that regulate how accessibility for computer software should be achieved. However, there is no native accessibility support in JavaFX. We have developed a package to achieve at least basic accessibility – mainly for assisting visually impaired people with using our virtual event platform through a Screen Reader.
As Swing directly supports accessibility via javax.accessibility, we have added a Swing component to the enclosing JFrame via the non-public API of Scene. This Swing component then accesses the nodes in the JavaFX scenegraph which implement the Accessible interface in order to determine the position of the nodes and their content. The Screen Reader then queries the graph to gather information for output (e.g. text-to-speech, sound icons, or a Braille output). The source code of the solution can be found in this project.
To use the accessibility support, you just have to use the fxaccessible subclass instead of the JavaFX nodes. Also add some descriptionText for the non-text elements. Everything else should be automatically be done by Swings accessibility support. We have currently only tested the solution on with Apple VoiceOver. It would be great to get feedback for some other Screen Reader systems.