1 year ago

#386564

test-img

Ari Black

Java Accessibility: Emulate ARIA role "alert"

I'm writing a Java app and I'm making sure that every bit of it is compatible with screen readers. Having worked with screen readers in the past when doing web development, I assumed, perhaps foolishly, that the behaviour would be much the same in Java.

What I'm particularly struggling with is with providing alert text without popping up a dialog. I am providing a status update which is useful information but doesn't require any user interaction.

In a browser, all I had to do was give a DIV the ARIA role "alert" (Alert Role).

Now I'm trying to accomplish the same thing with Swing components but I don't see any clear way to do it. The Java accessibility package has an Alert role (AccessibleRole class) whose description suggests the same behaviour but I don't see any Swing components that use it or a way to make them change roles (seems to be hard-coded).

The How to Support Assistive Technologies guide touches on the idea of creating custom components but barely scratches the surface and doesn't seem to mention the Alert class.

Any idea what some good next steps might be?

java

accessibility

0 Answers

Your Answer

Accepted video resources