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 214434

Summary: Background property for JButton & JProgressBar doesn't reflect on the GUI builder & in Form Preview Mode
Product: guibuilder Reporter: ytn01
Component: Natural LayoutAssignee: issues@guibuilder <issues>
Status: RESOLVED INVALID    
Severity: normal CC: asenk
Priority: P1    
Version: 7.2   
Hardware: Macintosh   
OS: Mac OS X   
Issue Type: DEFECT Exception Reporter:

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());