Click to See Complete Forum and Search --> : Swing lost focus event problem in browser


125
February 28th, 2000, 12:07 PM
I use a lost focus event for data validation for a JTextField in my applet -- a message box pops up on lost focus if invalid data input is detected. While this works fine from IDE (in my case, Visual Cafe), if I try it from the browser however, the same message box pops up many times each time the lost focus happens with invalid input. I already checked and handled the tempery event from the lost focus routine and it works just as expected from the applet viewer. Does anyone has a solution to this problem? Or has someone heard of this before?

Thanks.

poochi
February 28th, 2000, 11:48 PM
check this post : http://codeguru.developer.com/bbs/wt/showpost.pl?Board=java&Number=6090

125
February 29th, 2000, 11:08 AM
Thanks Poochi,

Yes, I did handled the temporary event -- test to see if it is temporary and do nothing if it is. I don't have problem with that. My problem is that the lost focus event get called more times when I run the applet in web server/browser environment, while it works just fine from applet viewer or other IDEs. Every time I test it from the brower, the same message box I created pops up 2 or 4 times when focus lost event got fired with an invalid input in the testing JTextField.

Any ideas?

Thanks again.

Lifeng

poochi
February 29th, 2000, 04:46 PM
Can you post a simple and compilable code ?