mte01
asked on
Focus-Lost Event
How can we programmatically fire a Focus Lost event inside a function (so the program can go & do the code of the focus lost event, and then return to the function)?
Thanks in advance :)
Thanks in advance :)
http://java.sun.com/docs/books/tutorial/uiswing/events/focuslistener.html
ASKER
To clarify my question:
I want to do the following inside a function:
DefaultFocusManager fm = new DefaultFocusManager();
fm.processKeyEvent(jtablex ,KeyEvent. VK_TAB);
so I can programmatically process the TAB Key Event (as if the user has pressed this key - because some naive users foeget to press it after finishing editing). The problem with this code is that KeyEvent.VK_TAB is an integer not a KeyEvent object (and there is no overloaded function to take a component and a KeyEvent object), so what do I do?
P.S.: I want the code to be compatible to java 1.3.* (not above)
I want to do the following inside a function:
DefaultFocusManager fm = new DefaultFocusManager();
fm.processKeyEvent(jtablex
so I can programmatically process the TAB Key Event (as if the user has pressed this key - because some naive users foeget to press it after finishing editing). The problem with this code is that KeyEvent.VK_TAB is an integer not a KeyEvent object (and there is no overloaded function to take a component and a KeyEvent object), so what do I do?
P.S.: I want the code to be compatible to java 1.3.* (not above)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That did the trick! It initiated the focus Lost event, but my original problem was not solved (which I thought the focus_Lost event would solve it); I will post it in a new question