On Wed, 7 Dec 2022 20:27:41 GMT, Sergey Bylokhov <[email protected]> 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

Reply via email to