This problem is most noticeable when using engines/themes (such as clearlooks,
ubuntulooks, nimbus) that have rounded corners on one side of the spinner
text field and/or the spinner arrow buttons. The reason Swing spinner arrow
buttons are not showing up properly under the GTK L&F and these themes is that
Swing is currently just treating these arrow buttons as regular GtkButtons.
So the GTK engine will not know that they are associated with a GtkSpinButton,
and will therefore render them as regular buttons. The same can be said for
the text field of a GtkSpinButton: currently these are being treated as a
regular formatted text field, so the corners are being rounded on all sides,
instead of on just the one side.
To fix this, we have to treat SPINNER_ARROW_BUTTON and SPINNER_TEXT_FIELD
as separate entities in various parts of the code.
As for the size of the spinner arrow buttons, we currently have
ArrowButton.size hardcoded at 13, regardless of the engine/theme in use.
The spinner arrow button size can actually change depending on the engine/theme,
and in fact, it is dependent upon the text size used by the spinner. So to
fix this properly, we have to look at the Pango font size and the xthickness
value of the SPINNER style to appropriately calculate the size of the arrow
With these fixes in place, Swing's spinners are now much closer to native
ones. The only remaining issue is that Swing's spinners are 1 or 2 pixels
taller than native ones. We need to look into this eventually (and take
a holistic view of all text-related widgets), but that can happen under
a separate bugid.
The first issue above with spinners also applies to JComboBox, again
especially under engines like clearlooks that include rounded corners
on the combo box text field and arrow button. Since we're already fixing
spinners under this bugid, we should probably fix combobox as well since
the changes are very much related.
Extra care needs to be taken to make sure that spinners and comboboxes
look good in right-to-left orientation and in the disabled state. Currently
we have issues with both of these cases (as first reported in 6417110), so
we should also address those issues as part of this bug report.