Integrated: 4365952: Cannot disable JFileChooser

Tejesh R tr at openjdk.org
Mon Nov 6 13:32:25 UTC 2023


On Fri, 6 Oct 2023 05:10:18 GMT, Tejesh R <tr at openjdk.org> wrote:

> Invoking `setEnabled(false)` on an instance of `JFileChooser` the sub-components are unaffected since the sub-components didn't set/unset enabled explicitly. The fix address the issue and sets the Enabled flag to each sub-components. Along with setting the property to each sub components, the action listeners like mouseClick(Double too) and scroll actions has to be processed based on enabled/disabled property similar to other components. Since `JFilechooser` implementation varies based on LookAndFeel, the same had to be taken care for affected LookAndFeel also. 
> Note: `JFrame` being top level container handles frame disable using native method which couldn't be the case for `JFileChooser`. For `showDialog/showOpenDialog/showSaveDialog` the fix could be to set the one the enabled property for created single Dialog. But when an instance of `JFileChooser` is created and added to Frame (Without Dialog been created), disabling the `FileChooser` alone had to be done by handling each sub-components and listeners separately.

This pull request has now been integrated.

Changeset: 96e6e670
Author:    Tejesh R <tr at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/96e6e670b5e2f95b6222091611cd8922022ec4b1
Stats:     216 lines in 9 files changed: 214 ins; 0 del; 2 mod

4365952: Cannot disable JFileChooser

Reviewed-by: prr, abhiscxk

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

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


More information about the client-libs-dev mailing list