first of all: sorry cannot provide sscce. tried recreate problem on small project, without success, or should success, because working there!
so here problem: have editable jcombobox, should listen focus event clicking in editor component. doesn´t.
here code snippet attach listener:
cmbzoom.settooltiptext(locale.getstring("gui_zoomfactor")); cmbzoom.setfont(new font(font.sans_serif, font.plain, 16)); cmbzoom.setpreferredsize(new dimension(88, 29)); cmbzoom.seteditable(true); ((jtextfield)cmbzoom.geteditor().geteditorcomponent()).sethorizontalalignment(jtextfield.center); cmbzoom.geteditor().geteditorcomponent().addfocuslistener( new focuslistener(){ public void focusgained(focusevent arg0) { system.out.println("gained"); } public void focuslost(focusevent arg0) { system.out.println("lost"); } });
i have tried remove other listener on combobox, remove observer pattern, make combobox protected , attach listener on each child,...
i have tried reimplement written on post: jcombobox focuslost not firing-why that?
is there way debug events?
the whole project can viewed on github: https://github.com/nexxx/database-analyzer
the toolbar class can found here (code starting on line 98): https://github.com/nexxx/database-analyzer/blob/master/src/dba/gui/auxclasses/toolbars/toolbar.java
the fact same code causes problems in circumstances not others leads me suspect code may not executing on awt event dispatch thread.
Comments
Post a Comment