RFR: 8311031: JTable header border vertical lines are not aligned with data grid lines

Tejesh R tr at openjdk.org
Tue Jul 4 11:37:57 UTC 2023


On Tue, 4 Jul 2023 11:01:27 GMT, Tejesh R <tr at openjdk.org> wrote:

> The header border uses `g.drawLine` whereas the JTable data grid lines uses `SwingUtilities2.drawVLine` and `SwingUtilities2.drawHLine` to draw horizontal and vertical lines. The SwingUtilities2 uses `Graphics.fillRect` which contributes to the difference between the position of these two lines which happens/visible at higher ui scaling (difference in alignment between vertical lines of these two). The fix propose to use the same methods for metal L&F of JTable header border paint. 
> CI testing shows green.
> 
> ![image](https://github.com/openjdk/jdk/assets/94159358/f6d1d822-55ba-4ad3-9914-d3f68b67a6c5)

> ![image](https://user-images.githubusercontent.com/107542245/250886635-dfd80858-48df-4897-852f-e14528089276.png)
> 
> There is a small gap between the horizontal and vertical line in size column (above 1 or Green) whereas grid lines don't have any gap.
> 
> Is it correct?

That gap is caused because of alignment miss-match between vertical lines of header border and data grid lines. To be specific the header vertical line is slightly left (around a pixel) than data grid line.

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

PR Comment: https://git.openjdk.org/jdk/pull/14766#issuecomment-1620081745



More information about the client-libs-dev mailing list