Workswing und for Swing exceptions during lookandfeel switchover

Source: Internet
Author: User
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: javax.swing.plaf.ColorUIResource cannot be cast to java.util.Listat javax.swing.plaf.metal.MetalUtils.drawGradient(Unknown Source)at javax.swing.plaf.metal.MetalInternalFrameTitlePane.paintComponent(Unknown Source)at javax.swing.JComponent.paint(Unknown Source)at javax.swing.JComponent.paintChildren(Unknown Source)at javax.swing.JComponent.paint(Unknown Source)at javax.swing.JComponent.paintChildren(Unknown Source)at javax.swing.JComponent.paint(Unknown Source)at javax.swing.JLayeredPane.paint(Unknown Source)at javax.swing.JComponent.paintChildren(Unknown Source)at javax.swing.JComponent.paint(Unknown Source)at javax.swing.JComponent.paintChildren(Unknown Source)at javax.swing.JComponent.paint(Unknown Source)at javax.swing.JLayeredPane.paint(Unknown Source)at javax.swing.JComponent.paintChildren(Unknown Source)at javax.swing.JComponent.paint(Unknown Source)at javax.swing.JComponent.paintToOffscreen(Unknown Source)at javax.swing.BufferStrategyPaintManager.paint(Unknown Source)at javax.swing.RepaintManager.paint(Unknown Source)at javax.swing.JComponent._paintImmediately(Unknown Source)at javax.swing.JComponent.paintImmediately(Unknown Source)at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)at javax.swing.RepaintManager.prePaintDirtyRegions(Unknown Source)at javax.swing.RepaintManager.access$700(Unknown Source)at javax.swing.RepaintManager$ProcessingRunnable.run(Unknown Source)at java.awt.event.InvocationEvent.dispatch(Unknown Source)at java.awt.EventQueue.dispatchEventImpl(Unknown Source)at java.awt.EventQueue.access$000(Unknown Source)at java.awt.EventQueue$3.run(Unknown Source)at java.awt.EventQueue$3.run(Unknown Source)at java.security.AccessController.doPrivileged(Native Method)at java.security.ProtectionDomain$1.doIntersectionPrivilege(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)

The cause of this exception in my program is:

The program adds a japplet to the jframe. During lookandfeel switching, the input parameter is a japplet object, not a jframe object:

Swingutilities. updatecomponenttreeui (applet); // there is an error. If it is a jframe application, a jframe object should be passed in. If it is an applet, A japplet object should be passed in.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.