RFR: 8299522: JFilechooser open button size is incorrectly shown
Tejesh R
tr at openjdk.org
Tue Jan 10 04:52:50 UTC 2023
On Mon, 9 Jan 2023 18:59:52 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:
>
> If the programmer uses `CUSTOM_DIALOG`, they are responsible for setting the text and, if required, tooltip for the approve button, which is implied by the required `approveButtonText` parameter to [JFileChooser.showDialog](https://docs.oracle.com/en/java/javase/17/docs/api/java.desktop/javax/swing/JFileChooser.html#showDialog(java.awt.Component,java.lang.String)).
>
> As such, I don't think that adding a new entry to `UIManager` is the correct way to fix the bug.
>
> If `JFileChooser` is added into a frame or another container without using its `show*` methods, you have to explicitly set the text for approve button using [`setApproveButtonText`](https://docs.oracle.com/en/java/javase/17/docs/api/java.desktop/javax/swing/JFileChooser.html#setApproveButtonText(java.lang.String)).
>
> 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).
-------------
PR: https://git.openjdk.org/jdk/pull/11901
More information about the client-libs-dev
mailing list