Link to home
Start Free TrialLog in
Avatar of mte01
mte01Flag for Lebanon

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 :)
Avatar of thomas908
thomas908

Avatar of mte01

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)
ASKER CERTIFIED SOLUTION
Avatar of Mayank S
Mayank S
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mte01

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