Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Focus-Lost Event

Posted on 2004-09-03
6
Medium Priority
?
924 Views
Last Modified: 2008-03-17
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
Comment
Question by:mte01
  • 3
  • 2
6 Comments
 
LVL 8

Expert Comment

by:thomas908
ID: 11979154
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Author Comment

by:mte01
ID: 11979294
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
 
LVL 30

Accepted Solution

by:
Mayank S earned 1000 total points
ID: 11980042
I guess you need to create a FocusEvent object and post it to the event-queue using EventQueue.postEvent ().
0
 
LVL 3

Author Comment

by:mte01
ID: 11980251
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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Suggested Courses
Course of the Month21 days, 2 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question