Note that there are some explanatory texts on larger screens.

plurals
  1. POFocusListener on editable JCombobox not firing
    primarykey
    data
    text
    <p>First of all: Sorry that I cannot provide a SSCCE. I tried to recreate this problem on a small project, but without success, or should I say with success, because its working there!</p> <p>So here is my Problem: I have an editable JCombobox, which should listen to a focus event by clicking in the editor component. But it doesn´t.</p> <p>Here is a code snippet where I attach the listener:</p> <pre><code>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"); } }); </code></pre> <p>I have already tried to remove all other listener on the combobox, remove the observer pattern, make the combobox protected and attach the listener on each child,...</p> <p>I have also tried to reimplement it like written on this post: <a href="https://stackoverflow.com/questions/10293135/jcombobox-focuslost-is-not-firing-why-is-that">JCombobox focusLost is not firing-why is that?</a></p> <p>Is there a good way to debug events?</p> <p>The whole project can be viewed on Github: <a href="https://github.com/nexxx/Database-Analyzer" rel="nofollow noreferrer">https://github.com/nexxx/Database-Analyzer</a></p> <p>The toolbar class can be found here (code starting on line 98): <a href="https://github.com/nexxx/Database-Analyzer/blob/master/src/dba/gui/auxClasses/toolBars/ToolBar.java" rel="nofollow noreferrer">https://github.com/nexxx/Database-Analyzer/blob/master/src/dba/gui/auxClasses/toolBars/ToolBar.java</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload