Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / July 2006

Tip: Looking for answers? Try searching our database.

mnemonic on titledborder - accessibility

Thread view: 
laurentoget@gmail.com - 21 Jul 2006 20:44 GMT
I am currently working on the accessibility of a swing based GUI. I
have a number of GUI elements which have a titledBorder and I am
looking for a way to set up a mnemonic and/or a keyboard shortcut to
bring the keyboard focus to that element. I know how to achieve a
similar result with a jlabel, setLabelFor, and setDisplayedMnemonic,
but the titledBorder looks better, requires less code, and it also
automatically sets the accessibleName property to the title.

any clue?
Andrey Kuznetsov - 27 Jul 2006 07:48 GMT
>I am currently working on the accessibility of a swing based GUI. I
> have a number of GUI elements which have a titledBorder and I am
[quoted text clipped - 5 lines]
>
> any clue?

since TitledBorder is not a Component you can't do it directly,
but you may try to hack it.
You need 2 things:
1) to show mnemonic char in the TitledBorder - see in the source of
JLabel/LabelUI how to do it
2) move focus to your component if mnemonic key was pressed - you can do it
with ActionMap/InputMap

HTH

Andrey

Signature

http://uio.imagero.com Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.