How do I create a right click context menu in Java Swing?
You are probably manually calling setVisible(true) on the menu. That can cause some nasty buggy behavior in the menu. The show(Component, int x, int x) method handles all of the things you need to happen, (Highlighting things on mouseover and closing the popup when necessary) where using setVisible(true) just shows the menu without adding any … Read more