Java Swing: Caret-listener stops firing after JPopupMenu is shown
问题 I'm making a text-editor application, and I've run into an issue with my CaretListener not being fired when text is typed or pasted after a JPopupMenu is shown. I have added the CaretListener to a JTextArea with textArea.addCaretListener(new CaretListener() { public void caretUpdate(CaretEvent e) { runThisMethod(); } }); This works fine, and calls "runThisMethod()" whenever the caret moves (key press, text selection, etc...). In my application I have a JMenuBar, and also a JPopupMenu added