-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
17
-
generic
-
generic
ADDITIONAL SYSTEM INFORMATION :
I get the same results (line break) with OpenJDK 11, 15, 16, 17 (all 64 bit) (I did not test others)
I do not get the result on Oracle JDK 1.8.0_131 (32 bit) (I did not test others)
A DESCRIPTION OF THE PROBLEM :
When I set the text of a JLabel with HTML Bidirectional text The text breaks line and is on two lines instead of one. This only happens when the Windows Display Scale is not 100% (for example: problem occurs with value of 125%) I have display resolution of 1920 x 1080.
I also tried using parameter -Dsun.java2d.uiScale, it works for value of 1 and 2 not 1.25, 1.5, 3, or 4
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1.) Use High Resolution Display
2.) Set Windows Display Scale to 125%
3.) Run Source Code
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
label to display text on one line (note: msg and GridLayout is to guarantee label is at lest that wide)
ACTUAL -
label breaks into two lines
---------- BEGIN SOURCE ----------
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JOptionPane;
import java.awt.GridLayout;
public class Main
{
private static final String TEXT = "\u05D0\u05B2\u05DC\u05B5\u05D9\u05DB\u05B6\u05DD";
public static void main(String[] args)
{
String html = "<html>" + TEXT + "</html>";
JLabel label = new JLabel(html);
JLabel msg = new JLabel("The text should at least go out to here.");
JPanel panel = new JPanel();
panel.setLayout(new GridLayout(2,1));
panel.add(label);
panel.add(msg);
JOptionPane.showMessageDialog(null, panel);
}
}
---------- END SOURCE ----------
FREQUENCY : always
I get the same results (line break) with OpenJDK 11, 15, 16, 17 (all 64 bit) (I did not test others)
I do not get the result on Oracle JDK 1.8.0_131 (32 bit) (I did not test others)
A DESCRIPTION OF THE PROBLEM :
When I set the text of a JLabel with HTML Bidirectional text The text breaks line and is on two lines instead of one. This only happens when the Windows Display Scale is not 100% (for example: problem occurs with value of 125%) I have display resolution of 1920 x 1080.
I also tried using parameter -Dsun.java2d.uiScale, it works for value of 1 and 2 not 1.25, 1.5, 3, or 4
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1.) Use High Resolution Display
2.) Set Windows Display Scale to 125%
3.) Run Source Code
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
label to display text on one line (note: msg and GridLayout is to guarantee label is at lest that wide)
ACTUAL -
label breaks into two lines
---------- BEGIN SOURCE ----------
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JOptionPane;
import java.awt.GridLayout;
public class Main
{
private static final String TEXT = "\u05D0\u05B2\u05DC\u05B5\u05D9\u05DB\u05B6\u05DD";
public static void main(String[] args)
{
String html = "<html>" + TEXT + "</html>";
JLabel label = new JLabel(html);
JLabel msg = new JLabel("The text should at least go out to here.");
JPanel panel = new JPanel();
panel.setLayout(new GridLayout(2,1));
panel.add(label);
panel.add(msg);
JOptionPane.showMessageDialog(null, panel);
}
}
---------- END SOURCE ----------
FREQUENCY : always
- duplicates
-
JDK-8269854 JLabel with <html> always line wraps at emojis with Windows zoom
- Open