focusLost event not fired when I changed from JRE 1.3 to 1.4.2

Hi,

I have a reconcile screen. There are textboxes for each amount denominations(eg. 100$,50$). I have focuslost listeners for these textboxes. When I enter a value in 100$ text box and click on reconcile button, Focuslost method is called.There I process for total amount(textbox value*100). Then I call another method where I display a dialogbox for the user to confirm. this will have the total amount.

This was developed in JRE1.3.0.Now,I've shifted to JRE 1.4.2 - What is happening is when I enter a a value in 100$ text box and click on reconcile button, Focuslost method is not called.Instead call directly comes to the method where I call the dialogbox for the user confirmation. As a result, the dialog box is not showing the correct value.

What should I do to fire the focuslost event when I click my reconcile button?

[855 byte] By [@@Dark@@a] at [2007-11-26 22:47:14]
# 1

The focus subsystem was substantially revamped in 1.4, as you can read [url http://java.sun.com/j2se/1.4.2/docs/api/java/awt/doc-files/FocusSpec.html]here[/url],

and it appears you're running into problems due to that.

From your description, it sounds like there's an action listener on the Reconcile

button that calculates the total amount, and the focus listener pops the dialog to

display that amount.

What's happening now is the focus events are being (properly) delivered before

the action on the button is triggered. There's not much you can do about this

except to reorganize your flow to accomodate this. Either calculate the

reconcilation amount in your focus listener before displaying the dialog box,

or do both in the action listener for the reconcile button.

JayDSa at 2007-7-10 12:06:05 > top of Java-index,Desktop,Core GUI APIs...