Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 214434 - Background property for JButton & JProgressBar doesn't reflect on the GUI builder & in Form Preview Mode
Background property for JButton & JProgressBar doesn't reflect on the GUI bui...
Status: RESOLVED INVALID
Product: guibuilder
Classification: Unclassified
Component: Natural Layout
7.2
Macintosh Mac OS X
: P1 (vote)
: TBD
Assigned To: issues@guibuilder
issues@guibuilder
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-19 10:42 UTC by ytn01
Modified: 2012-06-19 12:09 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ytn01 2012-06-19 10:42:34 UTC
Changing background for JButton & JProgressBar doesn't reflect on the GUI builder & in Form Preview Mode, though appropriate code is generated & change is seen at runtime.

Steps to reproduce:
1. Create a new Java application
2. Add a JFrame to it.
3. Add a JButton & a JProgressBar into the JFrame,
4. Change background color property for both the JButton & JProgressBar,  & save the file
	*Notice these changes don't reflect on the GUI builder
5. Open preview for the Form
	*Still these changes don't get reflected on preview

However, Running the file shows the background colors correctly.
Also the necessary initialization code is there.

Product Version = NetBeans IDE 7.2 RC1 (Build 201206141830)
Operating System = Mac OS X version 10.7.4 running on x86_64
Java; VM; Vendor = 1.7.0_05
Runtime = Java HotSpot(TM) 64-Bit Server VM 23.1-b03
Comment 1 asenk 2012-06-19 12:09:47 UTC
This is not a bug, but it is a specific behavior of MacOS native laf . These components, that you mentioned, ignores background color property.

When you run a Form file, it runs with Nimbus laf, therefore you can see the diferences. You can use "preview->Nimbus" to see JFrame with the same laf as in runtime.

Or you can change the generated code to run JFrame with Mac OS native laf (Aqua).

Replace:
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
              if ("Nimbus".equals(info.getName())) {
              javax.swing.UIManager.setLookAndFeel(info.getClassName());
              break;
              }
            }

With: javax.swing.UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName());


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo