United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6292725 GTK L&F: JSpinner, JComboBox does not look like native
JDK-6292725 : GTK L&F: JSpinner, JComboBox does not look like native

Details
Type:
Bug
Submit Date:
2005-06-30
Status:
Closed
Updated Date:
2011-03-09
Project Name:
JDK
Resolved Date:
2011-03-08
Component:
client-libs
OS:
linux,solaris_10
Sub-Component:
javax.swing
CPU:
x86,sparc
Priority:
P4
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:

Related Reports
Backport:
Duplicate:
Relates:
Relates:
Relates:
Relates:

Sub Tasks

Description
FULL PRODUCT VERSION :
java version "1.6.0-ea"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-ea-b42)
Java HotSpot(TM) Client VM (build 1.6.0-ea-b42, mixed mode, sharing)


ADDITIONAL OS VERSION INFORMATION :
Fedora Core release 4 (Stentz)
Linux localhost.localdomain 2.6.11-1.1369_FC4 #1 Thu Jun 2 22:55:56 EDT 2005 i686 athlon i386 GNU/Linux

A DESCRIPTION OF THE PROBLEM :
There are some descreptancies between the native GTK+ LaF and native applications.

* The top spinner button appears to be drawn with the border of the bottom one, causing it to be rounded on the bottom rather than the top.
* The text entry widget is rounded on all four sides while the native one is rounded only on the ones that do not touch the buttons.
* The arrows are a bit larger than on the native ones.

Image: http://www.cse.ohio-state.edu/~eckenror/Java/Spinners.png

REGRESSION.  Last worked in version mustang

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run a Swing app that uses a JSpinner

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Spinner looks native
ACTUAL -
Spinner does not look native.

REPRODUCIBILITY :
This bug can be reproduced always.
###@###.### 2005-06-30 08:15:29 GMT

                                    

Comments
EVALUATION

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
button.

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.
                                     
2006-10-11



Hardware and Software, Engineered to Work Together