Processing a TAB KeyEvent
Posted on 2004-09-05
I wanted to programmatically process a TAB KeyEvent at a certain part of a program (as if the user has pressed the TAB Key). I wrote the following piece of code:
DefaultFocusManager fm = new DefaultFocusManager();
fm.processKeyEvent(jtablex,KeyEvent.VK_TAB); //where jtablex is a Component
The problem with this code was that KeyEvent.VK_TAB is an integer not a KeyEvent object (and there is no overloaded function that takes a component and a KeyEvent object).What do I do to process this KeyEvent?