-
Bug
-
Resolution: Cannot Reproduce
-
P3
-
None
-
6u2
-
sparc
-
solaris
On GTK LAF the disabled JComboBox is different with 6u2 b01.
1. The Text is not greyed out
2. The background color is also remains same.
It should be greyed out completely as in 7.0.
Run the following code, note that text of the selected item in the JComboBox look enabled, not greyed out.
import java.awt.*;
import javax.swing.*;
public class DisabledComboBox{
public static void main(String args[]) {
try {
UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName());
}catch(Exception e){
e.printStackTrace();
};
SwingUtilities.invokeLater(new Runnable() {
public void run() {
JComboBox jComboBox1 = new JComboBox();
jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Disable Combo", "Item1", "Item2"}));
jComboBox1.setEnabled(false);
JFrame test = new JFrame("Combo Text");
test.add(jComboBox1, BorderLayout.SOUTH);
test.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
test.setSize(300, 200);
test.setLocationRelativeTo(null);
test.setVisible(true);
}
});
}
}
1. The Text is not greyed out
2. The background color is also remains same.
It should be greyed out completely as in 7.0.
Run the following code, note that text of the selected item in the JComboBox look enabled, not greyed out.
import java.awt.*;
import javax.swing.*;
public class DisabledComboBox{
public static void main(String args[]) {
try {
UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName());
}catch(Exception e){
e.printStackTrace();
};
SwingUtilities.invokeLater(new Runnable() {
public void run() {
JComboBox jComboBox1 = new JComboBox();
jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Disable Combo", "Item1", "Item2"}));
jComboBox1.setEnabled(false);
JFrame test = new JFrame("Combo Text");
test.add(jComboBox1, BorderLayout.SOUTH);
test.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
test.setSize(300, 200);
test.setLocationRelativeTo(null);
test.setVisible(true);
}
});
}
}
- relates to
-
JDK-6292725 GTK L&F: JSpinner, JComboBox does not look like native
-
- Closed
-