RFR: 4337898: Serializing DefaultTableCellRenderer changes colors [v2]

Prasanta Sadhukhan psadhukhan at openjdk.org
Mon Dec 1 06:49:28 UTC 2025


On Fri, 28 Nov 2025 07:26:28 GMT, Alexander Zvegintsev <azvegint at openjdk.org> wrote:

>> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Automate test
>
> test/jdk/javax/swing/DefaultTableCellRenderer/DefRendererSerialize.java line 62:
> 
>> 60:     static JFrame createTestUI() {
>> 61:       String[][] rowData = { {"1-1","1-2","1-3"},
>> 62:                              {"2-1","2-2","2-3"},
> 
> I guess the test could be automated.
> 
> e.g. if we leave the central cell blank:
> 
> Suggestion:
> 
>                              {"2-1","","2-3"},
> 
> We can safely retrieve the pixel color from the center of the cell and check it against the white color
> 
> 
> Rectangle tableRect = table.getCellRect(1, 1, true);
> Point tableOnScreen = table.getLocationOnScreen();
> 
> Point p = new Point(
>         tableOnScreen.x + tableRect.x + tableRect.width / 2,
>         tableOnScreen.y + tableRect.y + tableRect.height / 2
> );
> 
> Color pixelColor = robot.getPixelColor(p.x, p.y);
> // ... color check

Thanks for the suggestion.
Test automated and color check before/after serialization/desrialization added

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28549#discussion_r2575810667


More information about the client-libs-dev mailing list