开发者

How to make a popup menu added to a JtextField to be invisible when the JTextField's focus is lost?

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


You can register a focus listener with the text field. The listener's focusLost() method should hide the menu.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜