Solved

Focus-Lost Event

Posted on 2004-09-03
6
906 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: 11979153
0
 
LVL 8

Expert Comment

by:thomas908
ID: 11979154
0
 
LVL 8

Expert Comment

by:thomas908
ID: 11979158
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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 250 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
HSSFWorkbook cannot be resolved error 10 51
Arrays.asList  VS  ArrayList 4 45
couple of eclipse 5 27
windows explorer path to command prompt 5 33
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

863 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now