When a JPopupMenu appears i want to execute some code for it. I can't figure out what listener should i use to trigger when the JPopupMenu becomes visible!
You should register a property change listener.
JPopupMenu menu = new JPopupMenu();
menu.addPropertyChangeListener("visible", myPropertyChangeListener);
In the listener you should check whether the new value of the event is Boolean.TRUE
.