RFR: 4365952: Cannot disable JFileChooser

Tejesh R tr at openjdk.org
Thu Dec 8 05:06:04 UTC 2022


On Wed, 7 Dec 2022 20:27:41 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

>> JFileChooser added to a JFrame similar to the example also works, I guess it's because frame is made inaccessible. But when we try to disable JFileChooser alone, it's not working because we need to disable each sub-component in which JFileChooser is made up of. As per debugging I found out that peer component is showing null for JFileChooser.disable whereas for JFrame the disabling is taken care by peer component in Component class.
>
> Why we cannot make inaccessible JFileChooser same as JFrame? We do not need to mark disable all components inside the frame(I guess jdialog and windows as well). Both are top level components, and probably should work in the same way.

I guess for frame, the disable/enable functionality is handled by the peer (Windows it is `WFramePeer`), whereas for the swing components it should be the components itself like it is for all other components (Like in AbstractButton, JComboBox, JList).

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

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



More information about the client-libs-dev mailing list