Hi Eirik, Thank you for bringing this up.
On 30/03/2022 20:22, Eirik Bakke wrote:
In fact, Windows 10 renders titled border flat: one grey line instead of etched border that was used in previous versions. Shall we update Swing's Windows L&F?
Here my point was that the rendering of GroupBox control in Windows has changed. Windows used to use an etched border that TitledBorder in Swing continues to use. Yet Windows 8.1 and 10 use a single grey line for GroupBox control which differs from what Swing uses. As such Windows Look and Feel in Swing does not represent native Windows rendering for the same kind of thing.
In the Windows L&F, the following borders all display badly on 150% HiDPI scaling, and would benefit from a fix: TextField.border, PasswordField.border, FormattedTextField.border, ScrollPane.border, PopupMenu.border, Menu.border, ToolTip.border, as well as the borders for JSpinner and JComboBox.
You're right all the borders are affected. I hope we'll think out a common approach to rendering borders which ensures all the edges are of the same thickness. Once it's done here for the EtchedBorder, painting other borders should be updated as well.
I once did some work to fix these 150% HiDPI scaling border issues on the NetBeans IDE; see https://github.com/apache/netbeans/pull/1777 and https://github.com/apache/netbeans/pull/2965 and https://github.com/apache/netbeans/blob/master/platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/windows8/Windows8LFCustoms.java
I'll take a closer look at your approach. It could be useful.
The issue https://bugs.openjdk.java.net/browse/JDK-8241561 is also similar. Just passing by... thanks for your work on maintaining Swing! -- Eirik Bakke (Committer on the Apache NetBeans project.)
-- Regards, Alexey