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?
views:
101answers:
1
Q:
How to make a popup menu added to a JtextField to be invisible when the JTextField's focus is lost?
+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
2009-12-17 10:32:33
Thank you! ........
artaxerxe
2009-12-17 10:36:42