JDK-6605982 : Nimbus L&F: PIT : Left side of Editable JComboBox is having lesser space than right side in pit bui
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6u5
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_vista
  • CPU: x86
  • Submitted: 2007-09-18
  • Updated: 2011-02-16
  • Resolved: 2008-01-09
Related Reports
Duplicate :  
Description
Left side of the editable JCombobox is having lesser space when compare to the right of the editable Jcombobox. Actually both the space should be of the same. Already a similar bug is filed which says that space is too high bug id . you can see the bug for more information. http://monaco.sfbay/detail.jsf?cr=6594640.  I have attached the screen shot.

Step to reproduce
------------------
1) Run the above testcase.
2) type some long string into the editable Jcombobox. Select the text & observe that there is less space towards the left side of the combobox & there is a large space can be seen towards the right side. If you see the same then the bug is reproduced.





source begin
-------------------
import javax.swing.JFrame;
import javax.swing.JComboBox;

public class NimusPITBuildJComobBoxBus {
	private JFrame frame=null;
	private JComboBox comboBox=null;

	NimusPITBuildJComobBoxBus(){
		frame = new JFrame();
		frame.setLayout(new java.awt.FlowLayout());
		comboBox = new JComboBox();
		comboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "NimbusLAFItem 1", "NimbusLAFItem 2", "NimbusLAFItem 3", "NimbusLAFItem 4", "NimbusLAFItem 5", "NimbusLAFItem 6", "NimbusLAFItem 7", "NimbusLAFItem 8", "NimbusLAFItem 9", "NimbusLAFItem 10" }));
		comboBox.setEditable(true);
		frame.add(comboBox);
		frame.pack();
		frame.setVisible(true);
	}

	public static void main(String []args){
		javax.swing.SwingUtilities.invokeLater(new Runnable(){
			public void run(){
				new NimusPITBuildJComobBoxBus();
			}
		});
	}
}
-------------------
source end

Comments
EVALUATION The margins are equal on left and right but the focus and border are drawn in within the left margin making it appear smaller. So we need to reduce the right to match visualy.
09-01-2008