posted 19 years ago
Hi, there:
I have an application, with a JTextField when that textfield gained focus, a popup menu is shown, and when it lost focus, the popup menu is hidden.
My focus listener class is listed below, where popup is JPopupMenu, and function displayPopup() is just to call show() in JPopupMenu:
Everything works fine in jdk 1.3 version. In jdk1.4_2 version, I met following issues:
1. whenever the text field gained the focus, the application keeps calling "focusGained()", and "focusLost()" functions endlessly (it seems the system keeps sending those focus events endlessly);
2. if I removed that "popup.setVisible(false)" in focusLost, then, it seems no other component can gain the focus anylonger.
So, very appreciated if anyone can give me some help, is that a bug in 1.4.2 or is there any way to work around?
Thanks a lot
David