Skip to main content

ClassCastException when using MultiLookAndFeel and Nimbus

2 replies [Last post]
pietblok
Offline
Joined: 2003-07-17

Hi,

I got a ClassCastException when trying to switch to the Nimbus L&F.

MultiLookAndFeel is enabled because I add my own Auxiliary L&F.

(Is this the correct forum to report this type of bug?)

javax.swing.plaf.synth.DefaultMenuLayout.invalidateLayout seems not to be aware of the MultiLookAndFeel.

C:\Documents and Settings\Piet>java -version
java version "1.6.0_05-ea"
Java(TM) SE Runtime Environment (build 1.6.0_05-ea-b06)
Java HotSpot(TM) Client VM (build 1.6.0_05-ea-b06, mixed mode, sharing)

Windows XP

This is the stack trace:

java.lang.ClassCastException: javax.swing.plaf.multi.MultiPopupMenuUI cannot be cast to javax.swing.plaf.synth.SynthPopupMenuUI
at javax.swing.plaf.synth.DefaultMenuLayout.invalidateLayout(Unknown Source)
at javax.swing.BoxLayout.addLayoutComponent(Unknown Source)
at java.awt.Container.addImpl(Unknown Source)
at java.awt.Container.add(Unknown Source)
at javax.swing.JPopupMenu.add(Unknown Source)
at javax.swing.JPopupMenu.add(Unknown Source)
at javax.swing.plaf.synth.SynthInternalFrameTitlePane.addSystemMenuItems(Unknown Source)
at javax.swing.plaf.synth.SynthInternalFrameTitlePane.assembleSystemMenu(Unknown Source)
at javax.swing.plaf.basic.BasicInternalFrameTitlePane.installTitlePane(Unknown Source)
at javax.swing.plaf.basic.BasicInternalFrameTitlePane.(Unknown Source)
at javax.swing.plaf.synth.SynthInternalFrameTitlePane.(Unknown Source)
at javax.swing.plaf.synth.SynthInternalFrameUI.createNorthPane(Unknown Source)
at javax.swing.plaf.basic.BasicInternalFrameUI.installComponents(Unknown Source)
at javax.swing.plaf.basic.BasicInternalFrameUI.installUI(Unknown Source)
at javax.swing.plaf.multi.MultiInternalFrameUI.installUI(Unknown Source)
at javax.swing.JComponent.setUI(Unknown Source)
at javax.swing.JInternalFrame.setUI(Unknown Source)
at javax.swing.JInternalFrame.updateUI(Unknown Source)
at javax.swing.SwingUtilities.updateComponentTreeUI0(Unknown Source)
at javax.swing.SwingUtilities.updateComponentTreeUI0(Unknown Source)
at javax.swing.SwingUtilities.updateComponentTreeUI0(Unknown Source)
at javax.swing.SwingUtilities.updateComponentTreeUI0(Unknown Source)
at javax.swing.SwingUtilities.updateComponentTreeUI0(Unknown Source)
at javax.swing.SwingUtilities.updateComponentTreeUI0(Unknown Source)
at javax.swing.SwingUtilities.updateComponentTreeUI0(Unknown Source)
at javax.swing.SwingUtilities.updateComponentTreeUI0(Unknown Source)
at javax.swing.SwingUtilities.updateComponentTreeUI0(Unknown Source)
at javax.swing.SwingUtilities.updateComponentTreeUI0(Unknown Source)
at javax.swing.SwingUtilities.updateComponentTreeUI0(Unknown Source)
at javax.swing.SwingUtilities.updateComponentTreeUI(Unknown Source)
at org.pbjar.plaf.EmptyXManager$3$1.run(EmptyXManager.java:497) // at this line SwingUtilities.updateComponentTreeUI(component) is executed
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

Thanks,

Piet

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
rogyeu
Offline
Joined: 2006-07-30

Swing & AWT forum is a better place to post Nimbus issue:
http://forums.java.net/jive/forum.jspa?forumID=74

Could you please provide a runnable sample along with detail steps for reproducing the issue?

Thanks,
Roger Y.

pietblok
Offline
Joined: 2003-07-17

Thanks Roger,

I took the thread to Swing and AWT at:

http://forums.java.net/jive/thread.jspa?threadID=33296

Sample code to reproduce the problem is available at:

http://www.pbjar.org/Nimbus/NimbusBug.jar

Thanks,

Piet