• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help me! GUI gurus.

 
xiao li
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to set mnemonic key for the title of the
tabbedpane, so user can use ALT+mnemonicKey to access different tabbedPane directly.
Thanks a lot!!!
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, if you are using 1.4 you can just setMnemonicAt(int tabIndex, int mnemonic).

setMnemonicAt
public void setMnemonicAt(int tabIndex,
int mnemonic)
Sets the keyboard mnemonic for accessing the specified tab. The mnemonic is the key which when combined with the look and feel's mouseless modifier (usually Alt) will activate the specified tab.
A mnemonic must correspond to a single key on the keyboard and should be specified using one of the VK_XXX keycodes defined in java.awt.event.KeyEvent. Mnemonics are case-insensitive, therefore a key event with the corresponding keycode would cause the button to be activated whether or not the Shift modifier was pressed.
This will update the displayed mnemonic property for the specified tab.

Parameters:
tabIndex - the index of the tab that the mnemonic refers to
mnemonic - the key code which represents the mnemonic
Throws:
IndexOutOfBoundsException - if tabIndex is out of range (tabIndex < 0 || tabIndex >= tab count)
Since:
1.4

If not - I suggest that you read the code for how they did it in 1.4 and do that yourself.
 
xiao li
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Cindy, you are my saver.
 
xiao li
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guru,
could you tell me where can i download java1.4 source code? thanks a lot!
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its part of the sdk1.4.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic