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 199592 - CCE from NimbusStyle.getFontForState
Summary: CCE from NimbusStyle.getFontForState
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Options (show other bugs)
Version: 7.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: Milutin Kristofic
URL:
Keywords: L&F
: 183317 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-06-21 16:08 UTC by Jesse Glick
Modified: 2013-02-20 05:28 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 Jesse Glick 2011-06-21 16:08:17 UTC
When using --laf Nimbus and opening the Options dialog, I get in console:

INFO [org.netbeans.core.startup.layers.BinaryFS]: value = org.netbeans.modules.options.colors.HighlightingPanel from org-netbeans-modules-options-editor/OptionsDialogCategories/FontsColors/HighlightingPanel.instance
java.lang.ClassCastException: com.sun.java.swing.plaf.nimbus.DerivedColor$UIResource cannot be cast to java.awt.Font
	at com.sun.java.swing.plaf.nimbus.NimbusStyle.getFontForState(NimbusStyle.java:693)
	at javax.swing.plaf.synth.SynthStyle.installDefaults(SynthStyle.java:916)
	at com.sun.java.swing.plaf.nimbus.NimbusStyle.installDefaults(NimbusStyle.java:214)
	at javax.swing.plaf.synth.SynthStyle.installDefaults(SynthStyle.java:899)
	at javax.swing.plaf.synth.SynthLookAndFeel.updateStyle(SynthLookAndFeel.java:275)
	at javax.swing.plaf.synth.SynthScrollPaneUI.updateStyle(SynthScrollPaneUI.java:86)
	at javax.swing.plaf.synth.SynthScrollPaneUI.propertyChange(SynthScrollPaneUI.java:168)
	at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
	at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)
	at java.awt.Component.firePropertyChange(Component.java:8154)
	at java.awt.Component.setName(Component.java:956)
	at javax.swing.plaf.basic.BasicComboPopup.<init>(BasicComboPopup.java:317)
	at javax.swing.plaf.synth.SynthComboPopup.<init>(SynthComboPopup.java:26)
	at javax.swing.plaf.synth.SynthComboBoxUI.createPopup(SynthComboBoxUI.java:235)
	at javax.swing.plaf.basic.BasicComboBoxUI.installUI(BasicComboBoxUI.java:232)
	at javax.swing.plaf.synth.SynthComboBoxUI.installUI(SynthComboBoxUI.java:99)
	at javax.swing.JComponent.setUI(JComponent.java:662)
	at javax.swing.JComboBox.setUI(JComboBox.java:236)
	at javax.swing.JComboBox.updateUI(JComboBox.java:245)
	at javax.swing.JComboBox.init(JComboBox.java:210)
	at javax.swing.JComboBox.<init>(JComboBox.java:204)
	at org.netbeans.modules.options.colors.HighlightingPanel.initComponents(HighlightingPanel.java:142)
	at org.netbeans.modules.options.colors.HighlightingPanel.<init>(HighlightingPanel.java:95)
Caused: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
[catch] at org.netbeans.core.startup.layers.BinaryFS$AttrImpl.getValue(BinaryFS.java:565)
	at org.netbeans.core.startup.layers.BinaryFS$BFSBase.getAttribute(BinaryFS.java:402)
	at org.openide.filesystems.MultiFileObject.getAttribute(MultiFileObject.java:911)
	at org.openide.filesystems.MultiFileObject.getAttribute(MultiFileObject.java:844)
	at org.openide.filesystems.MultiFileObject.getAttribute(MultiFileObject.java:907)
	at org.openide.filesystems.MultiFileObject.getAttribute(MultiFileObject.java:844)
	at org.openide.filesystems.MultiFileObject.getAttribute(MultiFileObject.java:772)
	at org.openide.loaders.InstanceDataObject$Ser.instanceCreate(InstanceDataObject.java:1373)
	at org.openide.loaders.InstanceDataObject.instanceCreate(InstanceDataObject.java:821)
	at org.openide.loaders.FolderLookup$ICItem.getInstance(FolderLookup.java:594)
	at org.openide.util.lookup.AbstractLookup$R.allInstances(AbstractLookup.java:1011)
	at org.openide.util.lookup.ProxyLookup$R.computeResult(ProxyLookup.java:557)
	at org.openide.util.lookup.ProxyLookup$R.allInstances(ProxyLookup.java:497)
	at org.openide.util.lookup.ProxyLookup$R.computeResult(ProxyLookup.java:557)
	at org.openide.util.lookup.ProxyLookup$R.allInstances(ProxyLookup.java:497)
	at org.netbeans.modules.options.colors.FontAndColorsPanelController.rebuild(FontAndColorsPanelController.java:142)
	at org.netbeans.modules.options.colors.FontAndColorsPanelController.access$000(FontAndColorsPanelController.java:75)
	at org.netbeans.modules.options.colors.FontAndColorsPanelController$1.resultChanged(FontAndColorsPanelController.java:80)
	at sun.reflect.GeneratedMethodAccessor37.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.openide.util.WeakListenerImpl$ProxyListener.invoke(WeakListenerImpl.java:459)
	at $Proxy3.resultChanged(Unknown Source)
	at org.openide.util.lookup.AbstractLookup$NotifyListeners.run(AbstractLookup.java:527)
	at org.openide.loaders.FolderLookup$Dispatch.run(FolderLookup.java:314)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1424)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1968)

Probably ultimately a bug in the JRE, but cause needs to be investigated and a proper minimal test case created.
Comment 1 Antonin Nebuzelsky 2011-10-24 13:55:32 UTC
*** Bug 183317 has been marked as a duplicate of this bug. ***
Comment 2 Milutin Kristofic 2012-10-11 11:28:16 UTC
JDK bug http://bugs.sun.com/view_bug.do?bug_id=6785663
Comment 3 Stanislav Aubrecht 2012-11-07 09:42:53 UTC
When running under Nimbus l&f UI components must be created in EDT
Comment 4 Theofanis Oikonomou 2012-11-14 16:03:40 UTC
I do not think something can be done in options. Make sure that all the UI components (HighlightingPanel or other components controlled by the FontAndColorsPanelController) are created in EDT. Feel free to close this if nothing can be done.
Comment 5 Milutin Kristofic 2012-11-14 16:52:48 UTC
Lookup from FontsColorsController opens HighlightingPanel.instance not in EDT. It needs completely separate in awt components and methods for FontsColorsController.
Comment 6 Milutin Kristofic 2013-02-18 15:06:39 UTC
http://hg.netbeans.org/jet-main/rev/1b57b7126ede
Comment 7 Quality Engineering 2013-02-20 05:28:07 UTC
Integrated into 'main-golden', will be available in build *201302192300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/1b57b7126ede
User: Milutin Kristofic <mkristofic@netbeans.org>
Log: #199592 - CCE from NimbusStyle.getFontForState