Bug 214434 - Background property for JButton & JProgressBar doesn't reflect on the GUI builder & in Form Preview Mode
Summary: Background property for JButton & JProgressBar doesn't reflect on the GUI bui...
Status: RESOLVED INVALID
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Natural Layout (show other bugs)
Version: 7.2
Hardware: Macintosh Mac OS X
: P1 normal (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
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
Exception Reporter:


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