Here is perhaps another piece of the puzzle. I need to show the pop-up using the JMenuPopup
show(Component, x, y) method.
This is because the background of the pop-up needs to be transparent. If I use
setVisible(true), the pop-up uses heavyweight components, and they don't support transparency.
However, for a
test, I tried showing the pop-up using the
setVisible(true) method, and although the background of the pop-up was not transparent, I no longer had the problem with the first click getting lost. Of course, I need the background of the JPopupMenu to be transparent, so (I believe) I need to use the
show(Component, x, y) method to make the pop-up visible.
When I use
show(Component, x, y), I pass the the parent of my text editor control (which is the JPanel used as the content pane).
Does this provide any explanation why the first mouse click is getting lost and what I might be able to do about it?
Thanks,