Details
-
Bug
-
Resolution: Fixed
-
P4
-
8u72
-
Windows 7, HiDPI display
-
b114
-
generic
-
windows_7
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8156388 | 8u111 | Alexandr Scherbatiy | P4 | Resolved | Fixed | b01 |
JDK-8153961 | 8u102 | Alexandr Scherbatiy | P4 | Resolved | Fixed | b03 |
JDK-8162224 | emb-8u111 | Alexandr Scherbatiy | P4 | Resolved | Fixed | b01 |
Description
Steps to reproduce:
Run the code:
================
import javax.swing.*;
import java.awt.*;
import static javax.swing.JFrame.EXIT_ON_CLOSE;
public class JTextAreaTest {
public static void main(String[] args) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
e.printStackTrace();
}
SwingUtilities.invokeLater(() -> {
final JFrame frame = new JFrame();
frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
frame.setBounds(500, 500, 300, 200);
frame.setLayout(new BorderLayout());
final JLabel label = new JLabel("Regular Label");
frame.add(label, BorderLayout.NORTH);
final JTextArea textArea = new JTextArea("JTextArea Label");
frame.add(textArea, BorderLayout.CENTER);
System.out.println("Label font: " + label.getFont());
System.out.println("TextArea font: " + textArea.getFont());
frame.setVisible(true);
});
}
}
===============
Screenshots are attached.
System Output for Windows Look and Feel is:
Label font: javax.swing.plaf.FontUIResource[family=Tahoma,name=Tahoma,style=plain,size=21]
TextArea font: javax.swing.plaf.FontUIResource[family=Monospaced,name=Monospaced,style=plain,size=13]
System Output for standard Look and Feel is:
Label font: javax.swing.plaf.FontUIResource[family=Dialog,name=Dialog,style=bold,size=12]
TextArea font: javax.swing.plaf.FontUIResource[family=Dialog,name=Dialog,style=plain,size=12]
Note that the standard font sizes are too small. They don't respect the fact that we have a HiDPI display at all. However, the Windows Look and Feel font sizes for JLabel and JTextArea don't scale the same way, which is perhaps even more unfortunate.
Attachments
Issue Links
- backported by
-
JDK-8153961 [hidpi] JLabel font is twice bigger than JTextArea font on Windows 7,HiDPI, Windows L&F
- Resolved
-
JDK-8156388 [hidpi] JLabel font is twice bigger than JTextArea font on Windows 7,HiDPI, Windows L&F
- Resolved
-
JDK-8162224 [hidpi] JLabel font is twice bigger than JTextArea font on Windows 7,HiDPI, Windows L&F
- Resolved
- relates to
-
JDK-8149453 [hidpi] JFileChooser does not scale properly on Windows with HiDPI display and Windows L&F
- Resolved
-
JDK-8076545 Text size is twice bigger under Windows L&F on Win 8.1 with HiDPI display
- Resolved
-
JDK-8073320 Windows HiDPI Graphics support
- Resolved