JDK-6635257 : Nimbus L&F: Incorrect Custom Renderer JComboBox in JToolbar.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6u5,6u10
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic,windows_vista
  • CPU: generic,x86
  • Submitted: 2007-11-29
  • Updated: 2011-02-16
  • Resolved: 2008-03-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6u10 b13Fixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Description
When a Custom Render Jcombobox is added to the JToolbar , the combobox is not incorrect. I have two issues .
1)The arrow button of the combobox is incorrect. 
2)Left side of the popup is 1 to 2 pixel towards the right & this is seen only in 6u10 b07 onwards. As it works correctly in 6u10 b06 & fail in 6u10 b07. Hence its a regression. I have attached the screen shot ( IncorrectComboBoxPopup.PNG).  
There were similar kind of bugs , but they both got fixed. But still it can be seen on the JToolbar.

Step to reproduce:-
-------------------
1) Run the attached testcase. observe the arrow button of JcomboBox which is in the south of the frame. The button is incorrect. Click on the Jcombobox & observe towards the left side  of the popup menu it is shifted 1 to 2 pixel right.  If you observe the same then the bug is reproduced. 
I even tested the same in 6u10 b08 pit build. Even there also i saw the same.

Comments
EVALUATION Further, the sizing is all messed up since Synth uses the height of the renderer to dictate the height of the combo. The solution is two fold: allow "padding" to be specified for the combo box current value, and allow "forceOpaque" to be specified which always ensures the renderer is non-opaque when rendering the current value and opaque when rendering the list. Note that this doesn't keep a determined developer from painting the background in both cases. Even if non-opaque, if the developer overrides the paintComponent() method of his renderer, then he can paint whatever he wants. It just means that the default pattern of extending DefaultListCellRenderer and using it in the combo box will work as expected. This fix also included the adjusting of various insets to make the combo look correct now that "padding" is being used. This fixed several other outstanding bugs.
08-02-2008