This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 87441 - Background color property for JSpinner code incorrect
Summary: Background color property for JSpinner code incorrect
Status: RESOLVED FIXED
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 5.x
Hardware: All Windows XP
: P3 blocker (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-18 17:20 UTC by hallkbrdz
Modified: 2010-02-25 07:43 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hallkbrdz 2006-10-18 17:20:21 UTC
When using the 5.5RC1 IDE to set the background color property for a JSpinner
swing object the following code is generated:

jSpinner1.setBackground(new java.awt.Color(225, 238, 249));

This is incorrect, as JSpinner is a complex object and this tries to set the
background color for the entire object. What is desired is to change the
background of the textfield, creating instead the following code:

((JSpinner.NumberEditor)jSpinner1.getEditor()).getTextField().setBackground(new
java.awt.Color(225, 238, 249));

Bryan
Comment 1 Jan Pokorsky 2006-10-18 18:30:24 UTC
wrong component, reassigning
Comment 2 Tomas Pavek 2006-10-30 13:06:58 UTC
Exposing internals of JSpinner does not seem to be a good solution to me. We
can't be sure what component is used as JSpinner's editor. Probably the same
problem exists with JComboBox. These components are simply not very friendly to
visual customization in GUI builders.

I suggest to simply hide the JSpinner's and JComboBox's properties that does not
makes sense to be set.
Comment 3 Jan Stola 2010-02-25 07:43:59 UTC
Fixed - background and foreground properties of JSpinner has been removed from Properties window of GUI Builder.

Modified file: http://hg.netbeans.org/cdev/rev/482b54e55172