RFR: 4938801: The popup does not go when the component is removed. [v3]
Prasanta Sadhukhan
psadhukhan at openjdk.org
Tue Jul 22 08:28:52 UTC 2025
On Mon, 21 Jul 2025 17:02:38 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:
>> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Test update
>
> src/java.desktop/share/classes/javax/swing/JPopupMenu.java line 962:
>
>> 960: ui.uninstallUI(this);
>> 961: if (oldInvoker != null) {
>> 962: oldInvoker.removePropertyChangeListener(propListener);
>
> This won't remove the install `propListener` because a new instance of the listener is created each time the method is called.
Fixed..
> test/jdk/javax/swing/JPopupMenu/TestPopupInvoker.java line 71:
>
>> 69: } catch (Exception e) {}
>> 70: System.out.println("Removing popup invoker from the container.");
>> 71: box.remove(invo);
>
> This breaks Swing contract that components must be accessed via EDT only.
Test updated
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26407#discussion_r2221680253
PR Review Comment: https://git.openjdk.org/jdk/pull/26407#discussion_r2221681291
More information about the client-libs-dev
mailing list