On Tue, 10 Jan 2023 04:50:08 GMT, Tejesh R <[email protected]> wrote:

> > Taking the above into account, 
> > [JDK-8299522](https://bugs.openjdk.org/browse/JDK-8299522) is **Not an 
> > Issue**.
> 
> @aivanov-jdk Agree to your point. But I added the default text and tooltip as 
> a fallback text which is already in aqua L&F. It's always safe to add a 
> default text when user doesn't add explicitly, since it affects the button 
> size in some L&F (like Metal) and empty text button in some other L&F (like 
> windows).

Yet it is explicitly stated in the documentation that you are expected to 
explicitly provide the text for the Approve button if you use `CUSTOM_DIALOG` 
type.

This case is handled gracefully when the `showDialog` method is used, the 
Approve button has `Open` text at least in Windows and Metal L&Fs. This happens 
in Aqua L&F too.

Thus, this situation is already handled by the API which is most commonly used 
with `JFileChooser`.

I suggest handling the missing text for the Approve button if a custom dialog 
is used with adding a `JFileChooser` instance as component by falling back to 
the `Open` type.

If you prefer going this route and add new properties, I suggest following 
what's used in Aqua L&F that is `choose-` prefix for the properties and member 
names.

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

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

Reply via email to