• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Mnemonic to Button in Windows look and feel  RSS feed

 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a swing application. The look and feel for that application is WINDOWS LOOK AND FEEL. I have a JButton in it. When i try to set the mnemonic for that button, I am not getting the '-' icon below that particular letter in the button Name.

JButton button = new JButton("OK");
button.setMnemonic('O');

Same code works if i just change the look and feel to defalt java look and feel.
 
Author
Ranch Hand
Posts: 964
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Karthick Dharani Vidhya:
I have a swing application. The look and feel for that application is WINDOWS LOOK AND FEEL. I have a JButton in it. When i try to set the mnemonic for that button, I am not getting the '-' icon below that particular letter in the button Name.

JButton button = new JButton("OK");
button.setMnemonic('O');

Same code works if i just change the look and feel to defalt java look and feel.



I don't pay attention to windows operating system all that often, but I just opened the winXP control panels and looked at all the buttons. None of them had any letters underlined. Do you see any native windows buttons with underlined letters? If not I would guess the windows LnF is simply emulating the native windows operating system in this regard.
[ April 17, 2008: Message edited by: Brian Cole ]
 
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For Windows look and feel, you need to press Alt first to see the underlined letter. It's different form Metal look and feel.
 
Sheriff
Posts: 21423
94
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From another topic:

Originally posted by Michael Dunn:
if xp, the default for mnemonics is 'hidden' (I think)

control panel/display/appearance/effects
and uncheck 'Hide underlined letters......'

 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!