JDK-6641813 : Nimbus L&F :The scrollbar in JComboBox appears only for the first click in 6u10 b09 pit build.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6u10
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_10
  • CPU: sparc
  • Submitted: 2007-12-14
  • Updated: 2011-02-16
  • Resolved: 2008-02-06
Related Reports
Duplicate :  
Description
The scrollbar in JComboBox appears only for the first click and then disappears for the subsequent clicks.

Steps To Reproduce:

1. Run the testcase pasted below.

2. Click the first comboBox which has a single item .Observe the Scrollbar.
Now click the Combobox again , the Scrollbar disappears.
This happens for less than 9 items added.

3. Click on the second ComboBox which has nine items , the Scrollbar remains even after the
subsequent clicks.

import javax.swing.JFrame;
import javax.swing.JComboBox;
import java.util.Vector;

public class ScrollBarVisibleBug {
	JFrame frame = null;
	JComboBox combo1=null;
	JComboBox combo2= null;

	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");

		frame.add(combo2 = new JComboBox(items2));


		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();
			}
		});
	}
}

Comments
EVALUATION There was a issue with scrollpane borders and focus that was effecting ComboBox in b09 this was fixed in 6610132
06-02-2008