-
-
Notifications
You must be signed in to change notification settings - Fork 268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unstable table grid line width with 125% scale on Windows #152
Comments
Yes, this is a common problem with painting in Java on scaled displays. Window LaF and Metal have the same problems. FlatLaf currently uses I tried to use anti-aliasing, which looks better, but the grid lines are too thick IMHO (125%; Java 14): And with anti-aliasing the selection has gaps if grid lines are disabled, which is the default: Grid lines are disabled, but anti-aliasing causes gaps between cells: Probably have to re-implement table painting in For now I would recommend to use a lighter color for the grid lines. Then it is harder to notice 😉 If you want try anti-aliasing yourself, add following to @Override
public void paint( Graphics g, JComponent c ) {
FlatUIUtils.setRenderingHints( (Graphics2D) g );
super.paint( g, c );
} |
Fixed in commit 5ef0c9a It turned out that the fix for https://bugs.openjdk.java.net/browse/JDK-8133919
Nimbus does not have unstable grid line width because it has a copy of |
With this patch (I did't tested before your release, sorry) I see unstable grid over the selection (background/grid color). And we have lost the right border of the custom row header which is a simple one-column JTable which does not draw the last vertical line now (maybe this is not a bug if last vertical line is not specifyed in docs, I don't know -- it just worked before). |
Ah, now I see it too. That's probably because the lines are now thinner than the space between the cells... The fix for #46 is the reason for the missing right border of the row header... |
OK, fixing our row header border was simple :)
It seems you and us will end up with paintComponent() 'overloading' every pixel of Swing's default UI :))) |
Hi! I found that if the scale ('font size') is set to 125% (common on 15" FullHD laptop; Windows 10), the table grid is drawn with 1 or 2 pixel line depending on current position of the table inside the scroll pane. Sometomes some lines are 1 px and some 2 px. It also switching haotically while moving an internal frame with a table in it.
The only difference between these two screenshots is scrolling the table down. The horizintal lines become 2 px from 1 px. Vertical line are 1 and 2 px:
The text was updated successfully, but these errors were encountered: