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

Alexey Ivanov aivanov at openjdk.org
Fri Nov 28 20:05:46 UTC 2025


On Thu, 27 Nov 2025 21:42:10 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

> No, it’s not necessarily scrolling. It can remove items from the visible area and add items that should be visible.

What do you mean?

Scrolling means exactly this: move the visible area so that the item at the `index` becomes visible; this implies other items will become invisible.

> To do this, it only needs to update the current L&F. List.makeVisible() spec allows this.

I don't understand what you mean here, either.

---

Still why do you think the selection may change during this operation? If all the items in the list are selected, they have to remain selected, whatever the list itself does to ensure the item at the `index` is visible on the screen. If none of the items are selected, it has to remain so.

Calling `makeVisible` should never select or deselect items in the list.

In this test, `getSelectedIndexes` would return an array that contains `[0, 1, …, list.getItemCount() -1]`, in other words all the indexes of the items in the list.

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

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


More information about the client-libs-dev mailing list