Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6642595
Votes 0
Synopsis Nimbus L&F : Clicking on the disabled JCombobox acts like button on rollover
Category java:classes_swing
Reported Against
Release Fixed 6u10(b10)
State 10-Fix Delivered, Verified, bug
Priority: 2-High
Related Bugs
Submit Date 17-DEC-2007
Description
I have a frame, which having a disabled jcombobox. When i click on the disabled jcombobox it acts like a button on the rollover. This is incorrect disabled component should not any effect. I have attached the screen shot of the same.

Step to reproduce:
-----------------
1) Run the below testcase.
2) Click onthe combobox. If you see the jcombobox acting like a button on rollover then the bug is reproduced.

TestCase
--------
 import javax.swing.JFrame;
import javax.swing.JComboBox;
import java.util.Vector;
import javax.swing.JButton;

public class ScrollBarVisibleBug {
	JFrame frame = null;
	JComboBox combo1=null;
	JComboBox combo2= null;
	JButton b = new JButton("Press Me");
	ScrollBarVisibleBug(){
		frame = new JFrame();
		frame.setLayout(new java.awt.FlowLayout());

		Vector items1 = new Vector();
		items1.add("karen");
		//frame.add(combo1 = new JComboBox(items1));

		Vector items2 = new Vector();
		items2.add("One");
		items2.add("two");
		items2.add("three");
		items2.add("four");
		items2.add("five");
		items2.add("six");
		items2.add("seven");
		items2.add("eight");
		items2.add("nine");
		items2.add("Lawrence");
		items2.add("LawrencePremKumar");
		frame.add(combo2 = new JComboBox(items2));
		combo2.setEnabled(false);
		b.setEnabled(false);
		frame.add(b);
		frame.setSize(300,300);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setVisible(true);
	}
	public static void main(String []args){
		javax.swing.SwingUtilities.invokeLater(new Runnable(){
			public void run(){
				new ScrollBarVisibleBug();
			}
		});
	}
}
----------------------
Posted Date : 2007-12-17 12:34:46.0
Work Around
N/A
Evaluation
Simple fix, combo had state PRESSED not PRESSED+DISABLED when it was clicked on and disabled. Also combo arrow button could enter pressed state when combo was dissabled.
Posted Date : 2007-12-19 00:00:15.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang