RFR: 8299522: Incorrect size of Approve button in custom JFileChooser [v12]

Alexey Ivanov aivanov at openjdk.org
Wed Jan 18 15:50:22 UTC 2023


On Wed, 18 Jan 2023 14:54:01 GMT, Tejesh R <tr at openjdk.org> wrote:

> > Should it rather be set to a non-null value?
> > Personally, I think the tooltip for the Approve button isn't needed as its purpose is obvious. However, the tooltip is added in all the L&F, so in custom case there should also be the tooltip.
> 
> Yeah, but the fallback tooltip text for aqua L&F is set to null.
> 
> https://github.com/openjdk/jdk/blob/754f6e6116b8889c49abf34d01f6fc3e9f1b3cb7/src/java.desktop/macosx/classes/com/apple/laf/AquaFileChooserUI.java#L2055

**Change the code** so that it's not null just like with `getDefaultButton` in #12008. Make Aqua L&F consistent with other L&Fs.

[JDK-8300549](https://bugs.openjdk.org/browse/JDK-8300549): JFileChooser Approve button tooltip is null in Aqua L&F in CUSTOM_DIALOG mode

If `AquaFileChooserUI` had extended `BasicFileChooserUI`, it would've gotten the correct fallbacks automatically with your fix. But it doesn't.

Shall it be updated to extend `BasicFileChooserUI`?

Does it make sense to update `AquaFileChooserUI` to fallback to `OPEN_DIALOG` defaults if `CUSTOM_DIALOG` is set?

Since a special property exists for the text of the custom Approve button text, a new property for the custom tooltip should be added. Or `FileChooser.chooseButton.textAndMnemonic` property could be removed if the above suggestion is implemented.

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

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



More information about the client-libs-dev mailing list