| Author |
Help me! GUI gurus.
|
xiao li
Greenhorn
Joined: Apr 09, 2002
Posts: 13
|
|
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
Joined: Sep 29, 2000
Posts: 8521
|
|
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.
|
"JavaRanch, where the deer and the Certified play" - David O'Meara
|
 |
xiao li
Greenhorn
Joined: Apr 09, 2002
Posts: 13
|
|
Thanks Cindy, you are my saver.
|
 |
xiao li
Greenhorn
Joined: Apr 09, 2002
Posts: 13
|
|
Hi Guru, could you tell me where can i download java1.4 source code? thanks a lot!
|
 |
Cindy Glass
"The Hood"
Sheriff
Joined: Sep 29, 2000
Posts: 8521
|
|
|
Its part of the sdk1.4.
|
 |
 |
|
|
subject: Help me! GUI gurus.
|
|
|