views:

20

answers:

1

I have a requirement that disabled JButton be read by JAWS version 9. i.e. if I have a JButton with the text "True", it ought to be read something like "True, disabled button". But when I use setEnabled(false) it no longer participates in the tab focus sequence, and therefore never gets read. Is it possible to make a disabled JButton readable by JAWS as I've described?

My "solution" right now is to emulate disabled buttons and set the accessible name as follows:

button.setForeground(Color.GRAY);
button.getAccessibleContext().setAccessibleName(buttonText + " disabled");

But I'd really rather use real disabled buttons.

+2  A: 

As a jaws user who's had to fight with many a swing interface I do not believe this is possible and you should stick with your solution. Also of note rumor has it that Oracle has stopped work on the Java Access Bridge so new versions of Java may not work with jaws in future. I can't find a link to confirm or deny this one way or the other though. Even if Oracle has not stopped support for the Access Bridge there has been no meaningful work on it for the passed several years. I don't think it's possible to use a 64 bit JVM with Jaws and Swing but I could be wrong. In general the accessibility of Swing and Jaws is quite poor unless your in a controlled environment where you can make sure users aren't upgrading to new versions of software with out prior testing. While I understand user interface rewrites are nontrivial if one is going to be done in the future I'd look at moving from Swing to SWT. SWT works well with jaws out of the box since it uses standard controls under the covers. I use Eclipse as a fairly accessible IDE and all SWT applications I've looked at with the exception of UML editors are fairly accessible with Jaws and no customization.

Jared
Thanks Jared, I had suspected Swing and the Java Access Bridge were pretty shoddy, but this was my first Java desktop application and I didn't get to choose the API. I'm bummed to learn SWT would have been so much better, since we will probably have a pretty large number of JAWS users. But this is great information to have to influences future choices. Frankly, I'd much rather use .NET and WPF or WinForms.
Stephen Swensen