RFR: 8371657: [macosx] Programmatically selecting/deselecting List item triggers an ItemEvent

Sergey Bylokhov serb at openjdk.org
Thu Nov 27 21:44:45 UTC 2025


On Thu, 27 Nov 2025 19:12:19 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>> As of now, it should not change. However, this is lwawt, which uses the active swing l&f, and I do not see a reason why someone could not change that based on a design choice.
>
>> As of now, it should not change. However, this is lwawt, which uses the active swing l&f, and I do not see a reason why someone could not change that based on a design choice.
> 
> I can't come up with any reason where `makeVisible` changes the current selection. The purpose of the method is to ensure the item at the specified index is visible which involves scrolling the list if the item isn't currently visible.
> 
> I should never ever change the selected items.

No, it’s not necessarily scrolling. It can remove items from the visible area and add items that should be visible. To do this, it only needs to update the current L&F. List.makeVisible() spec allows this.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28245#discussion_r2570003913


More information about the client-libs-dev mailing list