Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with focus listener  RSS feed

 
jyothi ve
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I registered focus lisener on JTextField. The listener getting called 2 times during 'TAB' out.
Why does Focus Lost event gets called twice for all the JTextFields ??

I want to do some valiadtion on 'TAB' out of JTextField?
Is there any alternative for this?

Please advise ..

Thanks in advance
 
Johan Sun
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try printing all the focus listeners, see if somehow the same listener gets added twice.
i used the same approach to detect tab out, it only gets called once
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by jyothi ve:
I registered focus lisener on JTextField. The listener getting called 2 times during 'TAB' out.
Why does Focus Lost event gets called twice for all the JTextFields ??


Make sure the listener is added only once in the constructor... If ur code contains some other manipulation on the listeners added to the JTextField, I do suggest you to have a look carefully at those code...

Or you might want to provide us with a part of your code so that we can help you more...
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!