I made a JDialog and the modality works presumably fine
dialog.setModalityType(JDialog.ModalityType.APPLICATION_MODAL);
dialog.setVisible(true);
But then my problem is:
-
I´m throwing Jdialog after a jcombobox.setSelection() and I need to click twice in Accept button in order to hide the dialog, because dropdown popup is consuming the first click for closing himself. I fixed it by manually calling jcombobox.hidePopup() before calling the dialog, but I cannot understand if the later is modal, why the mouse events trigger things outside the window?`
-
My Main window buffers somehow the mouse events, so for those mouse events which are not activated when the modal dialog is drawn (as happens with the previous point), it seems they get buffered and are applied after dialog closure. Is this an expected behavior?
Thank u!
replace
jcombobox.hidePopup("doesn't make me sence")withActionListenerorItemListeneradded to theJComboBoxadd RequestFocusListener by @camickr for setting the
FocusOwnercorrectlyfor why reasons are there another
MouseListeners, maybe in the case that fird any events to theJComponentsthat you can’t to setFocuscorrectly