|
-
Jun 27th, 2002, 05:57 AM
#1
set tabindex/focus
I created a form in swing/jdk1.4 and I want to set tabindex or setFocus on pressing tab key to move cursor next field.
Please help and give any suggestions.
-
Jun 27th, 2002, 01:02 PM
#2
Dazed Member
Let's say that you have a JLabel and a JTextField. You can create a mnemonic for the label that when pressed will jump to the text field. setDisplayedMnemonic(char c) can be used on the JLabel and setLabelFor(Component c) can be used on the JTextField.
The other way would be to either set the nextFocusableComponent property or call the requestFocus() on the component itself.
If all you have is JTextFields and JLabels then the focus manager should just tab to the next JTextField when the tab key is pressed.
Last edited by Dilenger4; Jun 27th, 2002 at 03:11 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|