RFR: JDK-8294484: MetalBorder's FrameBorder & DialogBorder have border rendering issues when scaled [v3]

Harshitha Onkar honkar at openjdk.org
Fri Feb 3 22:13:53 UTC 2023


On Fri, 3 Feb 2023 19:51:33 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>> Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   minor change
>
> src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBorders.java line 375:
> 
>> 373:      */
>> 374:     @SuppressWarnings("serial") // Superclass is not serializable across versions
>> 375:     static final class FrameBorder extends AbstractMetalBorder implements UIResource {
> 
> If the class isn't used anywhere but `MetalBorders` class, does it make sense to declare the class `private`? I think it does, it conveys that this class is used only here.
> 
> This applies to other classes too.

Border classes are used within MetalLookAndFeel.java hence cannot be made private.

> src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBorders.java line 396:
> 
>> 394:      */
>> 395:     @SuppressWarnings("serial") // Superclass is not serializable across versions
>> 396:     static sealed class DialogBorder
> 
> Probably `DialogBorder` should extend `FrameBorder` to inherit and re-use `isActive` and `isResizable` methods: they're the same in both classes.

Since `isResizable` has to be overridden in this case as well, retaining the original class hierarchy.

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

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



More information about the client-libs-dev mailing list