JDK-6478904 : GTK L&F: scrollbars rendered incorrectly under Nimbus theme
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 5.0
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_9
  • CPU: generic
  • Submitted: 2006-10-05
  • Updated: 2011-03-09
  • Resolved: 2011-03-08
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 JDK 7
6u2Fixed 7 b03Fixed
Related Reports
Relates :  
Description
There are a few problems with scrollbars when used with Swing's GTK L&F and the
Nimbus theme on Solaris:
  1) The top and left buttons have an extra border on the top/left side.
  2) The bottom and right buttons look okay in the normal state, but are not
     rendered properly for the rollover or pressed states (they just look like
     the normal state in those cases).
  3) The scroll thumb does not align properly when positioned at either end of the
     trough (it appears to sit above the end of the arrow button).

Comments
EVALUATION Issues (1) and (2) from above are most likely bugs in the Nimbus engine itself and will be fixed as a Nimbus bug (bugid is 6483073); there's not much we can do from Swing to resolve those issues. However, issue (3) is something we can fix easily in Swing.
17-10-2006

EVALUATION 1,2) It appears that the Nimbus engine has some special hacks to deal with scrollbars in FireFox, and Swing's GTK L&F is hitting that case, which causes the top/left scroll button to be offset by a couple pixels and the bottom/right scroll button to be not rendered at all. Will need to discuss this further with the engineer responsible for Nimbus. 3) Under Nimbus, the scrollbar buttons are rectangular (e.g. 13x17 for a vertical scrollbar). However, the GTK L&F is currently assuming that scrollbar buttons will be square (we set the ScrollBar.squareButtons property to TRUE). Also, in SynthArrowButton, we only use the ArrowButton.size property to determine both the width and height of arrow buttons, and we're getting that size value from GtkRange's "slider-width" style property. This means that currently we are creating arrow buttons under Nimbus that are 13x13, and as a result the scrollbar thumb is free to paint over the ends of the trough. I propose that we fix this by introducing a new UI default, ScrollBar.buttonSize, the value of which is a dimension that depends on the orientation of the scrollbar. We can use "slider-width" to determine the width and "stepper-size" for the height of vertical scrollbar buttons, and vice versa for horizontal ones. We can use these values in SynthArrowButton.getPreferredSize() to create a rectangular button. We'll also have to change the default value of ScrollBar.squareButtons property to FALSE in GTKLookAndFeel.
05-10-2006