java.lang.ClassCastException

javax.swing.JList$4 See that $4? That's your problem You're trying to cast a JList inner class as the JList itself You might be able to get away with this by doing JList.this

Solutions on the web19761

  • via Oracle Community by 807549, 10 months ago
    javax.swing.JList$4 See that $4? That's your problem You're trying to cast a JList inner class as the JList itself You might be able to get away with this by doing JList.this
  • javax.swing.JList$4 cannot be cast to javax.swing.DefaultListModel
  • javax.swing.JList$4 cannot be cast to javax.swing.DefaultListModel
  • Stack trace

    • java.lang.ClassCastException: javax.swing.JList$4 See that $4? That's your problem You're trying to cast a JList inner class as the JList itself You might be able to get away with this by doing JList.this at BreezySwing.GBFrameDCListener.mouseClicked(GBFrame.java550) at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMultiaster.java:208) at java.awt.Component.processMouseEvent(Component.java:502) at java.awt.Component.processEvent(Component.java:4818) at java.awt.Container.processEvent(Container.java:1380) at java.awt.Component.dispatchEventImpl(Component.java:352) at java.awt.Container.dispatchEventImpl(Container.java:143) at java.awt.Component.dispatchEvent(Component.java:3367) at java.awt.LightweightDispatcher.retargetMouseEvent(Contaner.java:3214) at java.awt.LightweightDispatcher.processMouseEvent(Contaier.java:2938) at java.awt.LightweightDispatcher.dispatchEvent(Container.ava:2859) at java.awt.Container.dispatchEventImpl(Container.java:142) at java.awt.Window.dispatchEventImpl(Window.java:1566) at java.awt.Component.dispatchEvent(Component.java:3367) at java.awt.EventQueue.dispatchEvent(EventQueue.java:445) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EentDispatchThread.java:190) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EvetDispatchThread.java:144) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThead.java:138) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThead.java:130) at java.awt.EventDispatchThread.run(EventDispatchThread.jaa:98)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    You are the first who have seen this exception. Write a tip to help other users and build your expert profile.