-
Bug
-
Resolution: Fixed
-
P4
-
7
-
b16
-
x86
-
windows_vista
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8343258 | 17.0.14 | Goetz Lindenmaier | P4 | Resolved | Fixed | b02 |
FULL PRODUCT VERSION :
java version "1.7.0_02-ea"
Java(TM) SE Runtime Environment (build 1.7.0_02-ea-b06)
Java HotSpot(TM) 64-Bit Server VM (build 22.0-b04, mixed mode)
java version "1.6.0_27"
Java(TM) SE Runtime Environment (build 1.6.0_27-b07)
Java HotSpot(TM) 64-Bit Server VM (build 20.2-b06, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows Vista SP2 x64 [version 6.0.6002]
A DESCRIPTION OF THE PROBLEM :
Using Nimbus look and feel, any disabled JComboBox using a custom ListCellRenderer has the enabled font color instead of the disabled one. Others JComboBox components are well shown with disabled colors. Metal look and feel does not have this problem.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. javac DisabledComboTestCase.java
2. java -Dswing.defaultlaf=javax.swing.plaf.nimbus.NimbusLookAndFeel DisabledComboTestCase
(java 6:)
2. java -Dswing.defaultlaf=com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel DisabledComboTestCase
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The JComboBox on the right (with item "JComboBox with DefaultListCellRenderer") should like the "Simple JComboBox" on the left, including text disabled color.
ACTUAL -
The JComboBox on the right ("JComboBox with DefaultListCellRenderer") has the "enabled" text color.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.FlowLayout;
import javax.swing.DefaultListCellRenderer;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
public class DisabledComboTestCase {
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable(){
@Override
public void run() {
JComboBox combo = new JComboBox();
combo.addItem("Simple JComboBox");
combo.setEnabled(false);
JComboBox customCombo = new JComboBox();
customCombo.setRenderer(new DefaultListCellRenderer());
customCombo.addItem("JComboBox with DefaultListCellRenderer");
customCombo.setEnabled(false);
JFrame myFrame = new JFrame();
myFrame.setLayout(new FlowLayout());
myFrame.add(combo);
myFrame.add(customCombo);
myFrame.pack();
myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
myFrame.setVisible(true);
}
});
}
}
---------- END SOURCE ----------
java version "1.7.0_02-ea"
Java(TM) SE Runtime Environment (build 1.7.0_02-ea-b06)
Java HotSpot(TM) 64-Bit Server VM (build 22.0-b04, mixed mode)
java version "1.6.0_27"
Java(TM) SE Runtime Environment (build 1.6.0_27-b07)
Java HotSpot(TM) 64-Bit Server VM (build 20.2-b06, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows Vista SP2 x64 [version 6.0.6002]
A DESCRIPTION OF THE PROBLEM :
Using Nimbus look and feel, any disabled JComboBox using a custom ListCellRenderer has the enabled font color instead of the disabled one. Others JComboBox components are well shown with disabled colors. Metal look and feel does not have this problem.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. javac DisabledComboTestCase.java
2. java -Dswing.defaultlaf=javax.swing.plaf.nimbus.NimbusLookAndFeel DisabledComboTestCase
(java 6:)
2. java -Dswing.defaultlaf=com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel DisabledComboTestCase
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The JComboBox on the right (with item "JComboBox with DefaultListCellRenderer") should like the "Simple JComboBox" on the left, including text disabled color.
ACTUAL -
The JComboBox on the right ("JComboBox with DefaultListCellRenderer") has the "enabled" text color.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.FlowLayout;
import javax.swing.DefaultListCellRenderer;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
public class DisabledComboTestCase {
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable(){
@Override
public void run() {
JComboBox combo = new JComboBox();
combo.addItem("Simple JComboBox");
combo.setEnabled(false);
JComboBox customCombo = new JComboBox();
customCombo.setRenderer(new DefaultListCellRenderer());
customCombo.addItem("JComboBox with DefaultListCellRenderer");
customCombo.setEnabled(false);
JFrame myFrame = new JFrame();
myFrame.setLayout(new FlowLayout());
myFrame.add(combo);
myFrame.add(customCombo);
myFrame.pack();
myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
myFrame.setVisible(true);
}
});
}
}
---------- END SOURCE ----------
- backported by
-
JDK-8343258 Nimbus LAF: disabled JComboBox using renderer has bad font color
-
- Resolved
-
- relates to
-
JDK-8310072 JComboBox/DisabledComboBoxFontTestAuto: Enabled and disabled ComboBox does not match in these LAFs: GTK+
-
- Resolved
-
- links to
-
Commit openjdk/jdk/87b314a9
-
Commit(master) openjdk/jdk17u-dev/a72e14af
-
Review openjdk/jdk/12390
-
Review(master) openjdk/jdk17u-dev/3008
(1 links to)