RFR: JDK-8016524: [macosx] Bottom line is not visible for JTableHeader [v6]

Prasanta Sadhukhan psadhukhan at openjdk.java.net
Fri Feb 11 08:09:13 UTC 2022


On Thu, 10 Feb 2022 22:45:58 GMT, Harshitha Onkar <duke at openjdk.java.net> wrote:

>> Previously, the JTableHeader Bottom line wasn't visible on MacOS LAF (Aqua). With the fix the bottom line (light grey) is visible. 
>> 
>> Changes were made to AquaTableHeaderBorder.paintBorder method and the height of the component+border was adjusted in paint method.
>> 
>> A new test case (JTHeaderBorderTest.java) was added to test the fix as there was no corresponding test case present for this issue previously. The test checks if the border is visible by checking the color at the border location with the background color of the table and table-header, if both are different test case passes and it fails if the pixel color at border location matches either the table-header or table background color.
>
> Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Changed test case to use BufferedImage to prevent retina-pixel scaling issues

test/jdk/javax/swing/JTableHeader/8016524/JTHeaderBorderTest.java line 33:

> 31:  */
> 32: 
> 33: import java.awt.*;

please expand this wildcard import

test/jdk/javax/swing/JTableHeader/8016524/JTHeaderBorderTest.java line 90:

> 88:                 String headerColor = Integer.toHexString(table.getTableHeader().getBackground().getRGB());
> 89:                 String pixelColor = tableColor;
> 90:                 boolean isBottomLineVisible = false;

To nitpick, I will much rather use Color instead of converting to String as we are trying to check and compare for Color but it's not a dealbreaker.

test/jdk/javax/swing/JTableHeader/8016524/JTHeaderBorderTest.java line 93:

> 91: 
> 92:                 // scan table header region to check if bottom border of JTableHeader is visible
> 93:                 for (int y = Y_OFFSET; y <= Y_OFFSET+25; y++) {

Can't we use X_OFFSET for hardcoded 25 here?

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

PR: https://git.openjdk.java.net/jdk/pull/7219



More information about the client-libs-dev mailing list