java - how to Override FocusListener - Swing -


the application work override default jcombobox swing. leets call mycombobox. version of combobox implement focuslistener , contains 2 methods focusgained , focuslost.

now, in 1 of panel of application, form contains combobox of type:

mycombobox amycombobox = new mycombobox(); 

i want add listener on :

amycombobox.addfocuslistener(new focuslistener() {    public void focuslost(focusevent e) {        //do here    }    public void focusgained(focusevent e) {        //do else    } }); 

but when run code, never pass these method execute focusgained/lost mycombobox class.

is there way add listener on object implements focuslistener?

additional focuslistener should work unless instance used in mycombobox consumes event (awt event consumption).

try making example ordinary jcombobox -- narrowing down cause of problem.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -