Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 927
  • Last Modified:

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 :)
0
mte01
Asked:
mte01
  • 3
  • 2
1 Solution
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
mte01Author Commented:
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)
0
 
Mayank SAssociate Director - Product EngineeringCommented:
I guess you need to create a FocusEvent object and post it to the event-queue using EventQueue.postEvent ().
0
 
mte01Author Commented:
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
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now