tags:

views:

101

answers:

1

I have added to a JTextField a JPopupMenu. Unfortunatelly, when i change the focus from JTextField, or when i "minimize" the window, the JPopupMenu still is visible. I need to make it invisible if JTextField is loosing the focus. How can i do this?

+2  A: 

You can register a focus listener (http://java.sun.com/j2se/1.3/docs/api/java/awt/event/FocusListener.html) with the text field. The listener's focusLost() method should hide the menu

Itay
Thank you! ........
artaxerxe