| Author |
i try to get the VK_TAB in jtextfield but i cant,here is the code what i doing wrong? the other keys
|
ben oshran
Greenhorn
Joined: Jul 29, 2012
Posts: 4
|
|
this is the code...
private void jTextField18KeyReleased(java.awt.event.KeyEvent evt) {
// TODO add your handling code here:
if(evt.getKeyCode()==KeyEvent.VK_CONTROL){
jTextField3.setFocusable(true);
jTextField3.requestFocusInWindow();
}
}
buy the way i generate the code with netbeans...
|
 |
Darryl Burke
Bartender
Joined: May 03, 2008
Posts: 4167
|
|
ben oshran wrote:this is the code...
buy the way i generate the code with netbeans...
Why? The visual designer is an advanced tool. Until you're familiar with the Swing API and coding idioms, you're better off hand-coding your GUIs.
That said, your subject says
i try to get the VK_TAB in jtextfield
whereas the posted code uses KeyEvent.VK_CONTROL. And in any case, every KeyEvent is not guaranteed to be populated with the keyCode and/or keyChar. And as I remarked in your other thread, please use correct capitalization for the first word in a sentence, proper nouns, the first person singular I, and Java class and member names.
On a more fundamental level, what exactly are you trying to achieve? (Note: what, not how you are trying to achieve it.)
|
luck, db
There are no new questions, but there may be new answers.
|
 |
ben oshran
Greenhorn
Joined: Jul 29, 2012
Posts: 4
|
|
I'm trying to achive that i will put info in one jTextField and after that i will press the tab key and forward to other component that i want...
the code i use is :
any help?
|
 |
Darryl Burke
Bartender
Joined: May 03, 2008
Posts: 4167
|
|
i will press the tab key and forward to other component
For that, using a KeyListener isn't the right approach. See the first paragraph of my response in this recent thread for the right way to go about it.
And once again, please use proper capitalization.
|
 |
 |
|
|
subject: i try to get the VK_TAB in jtextfield but i cant,here is the code what i doing wrong? the other keys
|
|
|