How do using the ActionListener map the ENTER key as a TAB event? Effectively I want to generate a TAB keypressed when the user presses enter on a TextField.
Try just setting the focus to the next component on an enter key event via the requestFocus function.
Your component does have to know its successor for that though, which makes this solution actually a workaround when thinking OOP I - maybe somebody knows a better one:
this.addKeyListener(new KeyListener()
{
public void keyPressed(KeyEvent e)
{
if (e.getKeyCode() == KeyEvent.VK_TAB)
{
nextComponent.requestFocus();
}
}
});
Hope this helps
(note: if it does not compile or work: I did not test it #-))...
allow thyself to be the spark that lights the fire
haslo@haslo.ch - www.haslo.ch
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.