RFR: 4834298: JFileChooser.getSelectedFiles() failed with multi-selection and double-click [v3]

Tejesh R tr at openjdk.org
Thu Sep 8 10:45:49 UTC 2022


On Thu, 8 Sep 2022 10:32:32 GMT, Jayathirth D V <jdv at openjdk.org> wrote:

>> Tejesh R has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Updated based on review comments
>
> src/java.desktop/share/classes/sun/swing/FilePane.java line 1772:
> 
>> 1770:         } else {
>> 1771:             listSelectionModel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
>> 1772:             clearSelection();
> 
> When we move from multi-selection enabled to disable. We are clearing the selection and calling setSelectedFiles(null). Do we need to replicate similar state update when we move from multi-selection disable to enable (clearing selection and calling setSelectedFile(null))?
> 
> It looks like somewhere we are not clearing SelectedFile() and it is causing this issue.

If we replicate the same then previously selected files will be cleared and user wont be able to retain the selected files.

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

PR: https://git.openjdk.org/jdk/pull/9996



More information about the client-libs-dev mailing list