-
Bug
-
Resolution: Cannot Reproduce
-
P3
-
11, 17, 23, 24
-
generic
-
generic
ADDITIONAL SYSTEM INFORMATION :
Windows 11, Java 17.0.12
A DESCRIPTION OF THE PROBLEM :
When Windows display scaling 125% is used, JLabel fails to correctly draw the ellipsis ... glyphs when content does not fit the available space.
The issue seems to be SwingUtilities2.clipString which is using integer char width calculation to spot where available space ends.
REGRESSION : Last worked in version 8
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run test program with display scale 125%. Resize the window horizontally a little bit.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Ellipsis should be fully visible when content does not fit.
ACTUAL -
At times only one or two dots of the ellipsis are visible.
---------- BEGIN SOURCE ----------
public class Jlabelellipsis
{
public static void
main(String[] args)
throws Exception
{
javax.swing.UIManager.put(java.awt.RenderingHints.KEY_TEXT_ANTIALIASING, java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_GASP);
java.awt.Frame frame = new javax.swing.JFrame("");
javax.swing.JLabel label = new javax.swing.JLabel("A bunch of text, and so on, etc");
label.setFont(new java.awt.Font("Arial", java.awt.Font.ITALIC, 11));
label.setPreferredSize(new java.awt.Dimension(50, 30));
frame.add(label);
frame.pack();
frame.setVisible(true);
}
}
---------- END SOURCE ----------
FREQUENCY : always
Windows 11, Java 17.0.12
A DESCRIPTION OF THE PROBLEM :
When Windows display scaling 125% is used, JLabel fails to correctly draw the ellipsis ... glyphs when content does not fit the available space.
The issue seems to be SwingUtilities2.clipString which is using integer char width calculation to spot where available space ends.
REGRESSION : Last worked in version 8
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run test program with display scale 125%. Resize the window horizontally a little bit.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Ellipsis should be fully visible when content does not fit.
ACTUAL -
At times only one or two dots of the ellipsis are visible.
---------- BEGIN SOURCE ----------
public class Jlabelellipsis
{
public static void
main(String[] args)
throws Exception
{
javax.swing.UIManager.put(java.awt.RenderingHints.KEY_TEXT_ANTIALIASING, java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_GASP);
java.awt.Frame frame = new javax.swing.JFrame("");
javax.swing.JLabel label = new javax.swing.JLabel("A bunch of text, and so on, etc");
label.setFont(new java.awt.Font("Arial", java.awt.Font.ITALIC, 11));
label.setPreferredSize(new java.awt.Dimension(50, 30));
frame.add(label);
frame.pack();
frame.setVisible(true);
}
}
---------- END SOURCE ----------
FREQUENCY : always