JDK-8294484 : MetalBorder's FrameBorder & DialogBorder have border rendering issues when scaled
Type:Bug
Component:client-libs
Sub-Component:javax.swing
Affected Version:11,17,19,20
Priority:P4
Status:Open
Resolution:Unresolved
OS:generic
CPU:generic
Submitted:2022-09-27
Updated:2022-11-18
The Version table provides details related to the release that this issue/RFE will be addressed.
Unresolved : Release in which this issue/RFE will be addressed. Resolved: Release in which this issue/RFE has been resolved. Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.
MetalBorder's FrameBorder & DialogBorder have border rendering issues when scaled similar to JInternalFrame.
Comments
There's a lot of duplicate code in *Border classes. All of them, FrameBorder, DialogBorder, InternalFrameBorder, mostly look the same except for the colors and the condition when resizable highlights are painted.
I propose to abstract these into a helper class which does the painting, the colors are set in a subclass and the condition whether the resizable highlights are to be painted or not could be passed as a Predicate<T> or, more effectively, abstracted into another abstract method which can be called directly.
Private border classes can be safely refactored this way.
Some of the border classes are public API, we can't change inheritance in this case. However, we can still change the implementation and delegate to painting job to the new border painter class.
04-10-2022
Work on refactoring to utility method is in progress.