-
Java popup irritation
I have a JPopupMenu that I created and then displayed using setLocation and setVisible. However, I just upgraded to the latest version of the JRE and now a popup menu appears, but it doesn't work and doesn't disappear when I click away...
I changed the code to use the show method to display the popup and now it works, but now the focus handling isn't so good. i.e. Now if I want to leave the popup and click on a button somewhere else, I have to click twice: once to remove focus from the popup and again to actually click the button...
What is happening? Have they stuffed something up or have I?
And I tried on two computers, so the problem was definitely created by the change to the latest version of Java (6, update 16).
-
Difficult to say without seeing what your code looked like.
-
Ok right. Here's a simplified example of what I'm trying to do:
Code:
JList myList = new JList;
JPopupMenu popup = new JPopupMenu();
popup.add("a menu item");
popup.show(myList, myXCoordinate, myYCoordinate);
Is that enough detail?
-
Anyone have the same problem? Try making a JPopupMenu and then displaying it using setVisible. Make sure you have the latest JDK and JRE installed.