× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Ugh. This is a tough one, David. You want to see if the select event has fired when processing the focus lost but I don't think you can because the select event hasn't fired yet. Now, looking at it abstractly, I could see that you might say that technically the select event causes the loss of focus, but my guess is that the SWT designers want to put the events in a more "intuitive" sequence, meaning that the focus event is fired before the select.

Have you tried simply logging the events to see if indeed that is the case? Because if the UI framework sends the focus lost event before the button select event then I think you're out of luck using normal techniques. Of course, there are always ways around this--such as the focus event spawning a thread that in turn sends a message delayed a few milliseconds that actually executes the focus logic but only if a specific intervening event hasn't occurred--but it's an awful lot of work.

Joe

Here's the situation ... I have a text field on a panel with a button next to it.

The text field has a focus listener with code in the focus lost method. This method does some basic validation of text.

The button has a selection listener that pops up a selection dialog and populates the text field.

Problem is, if someone types in to the text field and then clicks the button, the focus event fires on the text field before the select event fires.

Does anyone know if there is a way I can detect that the select event has fired when processing the focus lost event?

Thanks!

david



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.