-
Bug
-
Resolution: Unresolved
-
P4
-
9, 17, 18, 19
-
x86_64
-
windows
ADDITIONAL SYSTEM INFORMATION :
Java version (OpenJDK):
openjdk version "17" 2021-09-14 / OpenJDK Runtime Environment Temurin-17+35 (build 17+35) / OpenJDK 64-Bit Server VM Temurin-17+35 (build 17+35, mixed mode, sharing)
Java version (Oracle):
openjdk version "19-ea" 2022-09-20 / OpenJDK Runtime Environment (build 19-ea+9-500) / OpenJDK 64-Bit Server VM (build 19-ea+9-500, mixed mode, sharing)
OS:
Edition Windows 11 Pro
Version 21H2
Installed on 06/10/2021
OS build 22000.527
Experience Windows Feature Experience Pack 1000.22000.527.0
A DESCRIPTION OF THE PROBLEM :
When not expanded, the text in a non-editable JComboBox gets truncated with ellipses when using the System LAF under Windows 11 and with a display scale of 125%.
The default LAF is OK and if the scale is 100% this is also OK.
Observed in Java 17 (termurin) and confirmed still present on Oracle Java 19 ea.
The appearance is similar toJDK-8179027 which was fixed in JDK 9 and the sample program given in that report still reproduces the problem now.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and run the code below under Windows 11 and with graphics scaling of 125%. This code was copied verbatim fromJDK-8179027 (https://bugs.openjdk.java.net/browse/JDK-8179027)
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The middle combo box should be wide enough to display the text. Note the right-hand box is OK because this is set editable.
ACTUAL -
The text is truncated with ellipses. The effect is similar to that reported inJDK-8179027 as https://bugs.openjdk.java.net/secure/attachment/67764/9eab166.PNG
---------- BEGIN SOURCE ----------
import java.awt.FlowLayout;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JTextField;
import javax.swing.UIManager;
public class ComboBoxLab extends JFrame
{
public ComboBoxLab()
{
setDefaultCloseOperation( EXIT_ON_CLOSE );
getContentPane().setLayout( new FlowLayout() );
getContentPane().add( new JTextField( "item 1" ) );
JComboBox< String > cboRo = new JComboBox< String >( new String[] { "item 1", "item 2", "item 3" } );
getContentPane().add( cboRo );
JComboBox< String > cboRw = new JComboBox< String >( new String[] { "item 1", "item 2", "item 3" } );
cboRw.setEditable( true );
getContentPane().add( cboRw );
pack();
setVisible( true );
}
public static void main( String[] args ) throws Exception
{
UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName() );
new ComboBoxLab();
}
}
---------- END SOURCE ----------
FREQUENCY : always
Java version (OpenJDK):
openjdk version "17" 2021-09-14 / OpenJDK Runtime Environment Temurin-17+35 (build 17+35) / OpenJDK 64-Bit Server VM Temurin-17+35 (build 17+35, mixed mode, sharing)
Java version (Oracle):
openjdk version "19-ea" 2022-09-20 / OpenJDK Runtime Environment (build 19-ea+9-500) / OpenJDK 64-Bit Server VM (build 19-ea+9-500, mixed mode, sharing)
OS:
Edition Windows 11 Pro
Version 21H2
Installed on 06/10/2021
OS build 22000.527
Experience Windows Feature Experience Pack 1000.22000.527.0
A DESCRIPTION OF THE PROBLEM :
When not expanded, the text in a non-editable JComboBox gets truncated with ellipses when using the System LAF under Windows 11 and with a display scale of 125%.
The default LAF is OK and if the scale is 100% this is also OK.
Observed in Java 17 (termurin) and confirmed still present on Oracle Java 19 ea.
The appearance is similar to
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and run the code below under Windows 11 and with graphics scaling of 125%. This code was copied verbatim from
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The middle combo box should be wide enough to display the text. Note the right-hand box is OK because this is set editable.
ACTUAL -
The text is truncated with ellipses. The effect is similar to that reported in
---------- BEGIN SOURCE ----------
import java.awt.FlowLayout;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JTextField;
import javax.swing.UIManager;
public class ComboBoxLab extends JFrame
{
public ComboBoxLab()
{
setDefaultCloseOperation( EXIT_ON_CLOSE );
getContentPane().setLayout( new FlowLayout() );
getContentPane().add( new JTextField( "item 1" ) );
JComboBox< String > cboRo = new JComboBox< String >( new String[] { "item 1", "item 2", "item 3" } );
getContentPane().add( cboRo );
JComboBox< String > cboRw = new JComboBox< String >( new String[] { "item 1", "item 2", "item 3" } );
cboRw.setEditable( true );
getContentPane().add( cboRw );
pack();
setVisible( true );
}
public static void main( String[] args ) throws Exception
{
UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName() );
new ComboBoxLab();
}
}
---------- END SOURCE ----------
FREQUENCY : always
- relates to
-
JDK-8179027 JComboBox too small under Windows LAF
- Resolved