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:
TitledBorder tb = new TitledBorder(BorderFactory.createEtched Border(), "More Colors to Choose", TitledBorder.LEFT, TitledBorder.BELOW_TOP, new Font ("SanSerif", Font.PLAIN, 18));
After adding all the radio buttons to both the button group and to the JPanel, I also "added" the TB using something like:
"JPanel.setBorder(TB)"
Now, when I use Explorer to look at this java application, some interesting things happen.
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:
g.drawString(getTitle(), etc...), which leaves the title string as TEXT.
If you trace through CompoundBorder, you can't find this same method, only references to:
outsideBorder.paintBorder(...), which I think creates a GRAPHIC versus TEXT?
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.