SimpleExample.java

This example looks at TitleBorders (TB). What I found has been interesting. I modified the file SimpleExample.java, and created a button group, with radio buttobns in a JPanel, and added a TB as follows:

After adding all the radio buttons to both the button group and to the JPanel, I also "added" the TB using something like:

Now, when I use Explorer to look at this java application, some interesting things happen.

  1. visually, the TB looks/acts/is the label for the button group
  2. if I place the mouse over a radio button in the JPanel, and query using Explorer, the TB title string (e.g., "More Colors to Choose") shows up as the *AccessibleParent's Name*.
  3. if I place the mouse over the JPanel, and query using Explorer, the TB title string (e.g., "More Colors to Choose") shows up as the *Accessible Name* of the JPanel.

Either situation #2 or #3 is great, as an assistive technology could actually find and speak, or whatever, the TB title string.

I then opened up the SwingSet demo., and took a quick look at the Radio Button Panel, since that also has several TBs, and I couldn't get any information from them. After debugging a while, I looked at the source code for both TitledBorder, and also at CompoundBorder, which is what the SwingSet uses on these radio button groups, and I think I've found the problem.

If you trace through TitledBorder, you eventually find where the title string is handled, with a line like:

If you trace through CompoundBorder, you can't find this same method, only references to:

If this is correct, then we'd suggest that CompoundBorder (and any others that paint GRAPHICS for TEXT) need to be changed and until it is changed, developers should not use of it.