I have a popup with settings displayed to the user. If you click outside it, its hidden but if you click inside it remains visible.
The event handler handling this behavior gets the Component
(that was clicked) and by using component.getParent()
recursively I can check if its a child of my settings panel. This has worked so far.
But I just added a JComboBox
to that panel and it turns out that the "selectable items popup" (does it have a name?) the combobox shows when clicked isnt a child of the combobox. Attempting to select something in a combobox would hide my settings panel.
Using the NetBeans debugger I can see its of the type BasicComboPopup$1
(is that an anonymous class?), but it isn't an instance of neither ComboPopup
, JPopupMenu
nor BasicComboPopup
.
I need a way to identify the owner/parent combobox of the "combobox popup" that was clicked.