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.
Summary: | Preview Design - Nimbus does not work | ||
---|---|---|---|
Product: | guibuilder | Reporter: | pribyl <pribyl> |
Component: | Code | Assignee: | issues@guibuilder <issues> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | CC: | hmichel, ldlopez, sustaining |
Priority: | P3 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
URL: | http://statistics.netbeans.org/exceptions/detail.do?id=151851 | ||
Issue Type: | DEFECT | Exception Reporter: | 151851 |
Attachments: |
stacktrace
stacktrace |
Description
pribyl
2009-05-27 11:31:14 UTC
Created attachment 82850 [details]
stacktrace
Product Version: NetBeans IDE 6.7 RC1 (Build 200905270001) Java: 1.6.0_14-ea; Java HotSpot(TM) Client VM 14.0-b12 System: Windows XP version 5.1 running on x86; Cp1250; cs_CZ (nb) Preview Design > Nimbus does nothing. Other previews works as expected. Exceptions can be seen in the IDE log. Once an Exception was thrown (and I reported it using Exception reporter), but I was not able to reproduce this one. Also on 6.5 with nimbus l&f. I guess this should be fixed in upcoming patch. I know it is not a big issue, but it does not look good - other L&F previews works fine, only poor Nimbus does not :) Thanks for answering. Yes, only with Nimbus it has problems. The problem already presents to the version 6.5.1 of NetBeans. Good bye The root cause exception seems to be this: java.lang.NullPointerException at com.sun.java.swing.plaf.nimbus.NimbusStyle.init(NimbusStyle.java:418) at com.sun.java.swing.plaf.nimbus.NimbusStyle.validate(NimbusStyle.java:359) at com.sun.java.swing.plaf.nimbus.NimbusStyle.getValues(NimbusStyle.java:927) at com.sun.java.swing.plaf.nimbus.NimbusStyle.getInsets(NimbusStyle.java:605) at javax.swing.plaf.synth.SynthStyle.installDefaults(SynthStyle.java:896) at javax.swing.plaf.synth.SynthLookAndFeel.updateStyle(SynthLookAndFeel.java:276) at javax.swing.plaf.synth.SynthPanelUI.updateStyle(SynthPanelUI.java:70) at javax.swing.plaf.synth.SynthPanelUI.installDefaults(SynthPanelUI.java:57) at javax.swing.plaf.basic.BasicPanelUI.installUI(BasicPanelUI.java:39) at javax.swing.plaf.synth.SynthPanelUI.installUI(SynthPanelUI.java:37) at javax.swing.JComponent.setUI(JComponent.java:673) at javax.swing.JPanel.setUI(JPanel.java:136) at javax.swing.JPanel.updateUI(JPanel.java:109) at javax.swing.JPanel.<init>(JPanel.java:69) at javax.swing.JPanel.<init>(JPanel.java:92) at javax.swing.JPanel.<init>(JPanel.java:100) at javax.swing.JRootPane.createGlassPane(JRootPane.java:528) at javax.swing.JRootPane.<init>(JRootPane.java:348) at javax.swing.JFrame.createRootPane(JFrame.java:260) at javax.swing.JFrame.frameInit(JFrame.java:241) at javax.swing.JFrame.<init>(JFrame.java:164) ... It seems specific to JDK 1.6.0_14, since it works fine for me on 1.6.0_10. NimbusStyle.validate changed in u14, it seems missing something in UIDefaults now. There were several changes in JDK 1.6u14 in Nimbus area that caused these problems. java.lang.NullPointerException at com.sun.java.swing.plaf.nimbus.NimbusStyle.init(NimbusStyle.java:418) at com.sun.java.swing.plaf.nimbus.NimbusStyle.validate(NimbusStyle.java:359) at com.sun.java.swing.plaf.nimbus.NimbusStyle.getValues(NimbusStyle.java:927) at com.sun.java.swing.plaf.nimbus.NimbusStyle.getInsets(NimbusStyle.java:605) at javax.swing.plaf.synth.SynthStyle.installDefaults(SynthStyle.java:896) ... NimbusStyle.validate() invokes NimbusStyle.compileDefaults() that uses UIManager.getLookAndFeelDefaults().entrySet() to obtain the set of name-value pairs. Our FormLAF.DelegatingDefaults didn't have entrySet() method overriden e.g. didn't delegate this call correctly. Once this issue was fixed, the following exception appeared: java.lang.ClassCastException: org.netbeans.swing.plaf.util.GuaranteedValue cannot be cast to java.awt.Color at com.sun.java.swing.plaf.nimbus.NimbusDefaults$ColorTree.propertyChange(NimbusDefaults.java:1653) at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339) at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(SwingPropertyChangeSupport.java:75) at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276) at javax.swing.UIDefaults.firePropertyChange(UIDefaults.java:827) at javax.swing.UIDefaults.put(UIDefaults.java:330) at java.util.Hashtable.putAll(Hashtable.java:466) at org.netbeans.modules.form.FormLAF.useIDELookAndFeel(FormLAF.java:354) at org.netbeans.modules.form.FormLAF.access$300(FormLAF.java:63) at org.netbeans.modules.form.FormLAF$2.run(FormLAF.java:278) at org.openide.util.Mutex.doEventAccess(Mutex.java:1355) at org.openide.util.Mutex.readAccess(Mutex.java:317) at org.netbeans.modules.form.FormLAF.executeWithLookAndFeel(FormLAF.java:259) at org.netbeans.modules.form.FormDesigner.createFormView(FormDesigner.java:580) ... This can be considered as a bug either in UIDefaults or in NimbusDefaults. The problem is that NimbusDefaults$ColorTree.propertyChange obtains UIDefaults.LazyValue, but it assumes that it will get resolved value e.g. java.awt.Color in this case. I have implemented a workaround for that - we resolve all LazyValues during initialization of preview look and feel. Finally, there were some changes in NimbusLookAndFeel listeners that made our preview very inaccurate. I have fixed that as well. Modified file: http://hg.netbeans.org/cdev/rev/2ea9ad9e0fcb The support of preview in a different look and feel is very fragile (it is not supported by Swing and the whole implementation is just a set of hacks). Therefore, I cannot guarantee that the fix doesn't have unexpected negative consequences. Hence, I believe that we shouldn't include it in the first patch for NB 6.7. I suggest to postpone it into some subsequent patch (once we verify that the fix is harmless). verified in NB Dev (20090708) Product Version: NetBeans IDE Dev (Build 200907080200) Java: 1.6.0_14; Java HotSpot(TM) Client VM 14.0-b16 System: Windows XP version 5.1 running on x86; Cp1250; cs_CZ (nb) Verified as well :) Today I tried to preview quite a lot different form files with many components in Nimbus LaF.Everything seems to be stable, I did not noticed any negative impact of this fix. The fix has been ported into the release67_fixes repository. http://hg.netbeans.org/release67_fixes/rev/3d01898527fc *** Issue 167943 has been marked as a duplicate of this issue. *** *** Issue 167943 has been marked as a duplicate of this issue. *** Build: NetBeans IDE Dev (Build 200909010201) VM: Java HotSpot(TM) Client VM, 14.2-b01, Java(TM) SE Runtime Environment, 1.6.0_16-b01 OS: Linux, 2.6.28-15-generic, i386 User Comments: Stacktrace: java.lang.NullPointerException at java.awt.Container.addImpl(Container.java:1045) at java.awt.Container.add(Container.java:365) at org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.createLayout(SwingLayoutBuilder.java:172) at org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.setupContainerLayout(SwingLayoutBuilder.java:107) at org.netbeans.modules.form.VisualReplicator.setupContainerLayout(VisualReplicator.java:815) at org.netbeans.modules.form.VisualReplicator.cloneComponent(VisualReplicator.java:747) Created attachment 86905 [details]
stacktrace
|