java.lang.ClassCastException: javax.swing.plaf.basic.BasicPanelUI cannot be cast to ui.ChatBuddy

Coderanch | Yaki Kumar | 5 years ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    Unable to understand how to remove exception raised here.

    Coderanch | 5 years ago | Yaki Kumar
    java.lang.ClassCastException: javax.swing.plaf.basic.BasicPanelUI cannot be cast to ui.ChatBuddy

    Root Cause Analysis

    1. java.lang.ClassCastException

      javax.swing.plaf.basic.BasicPanelUI cannot be cast to ui.ChatBuddy

      at ui.ChatManager$BuddyRenderer.getListCellRendererComponent()
    2. ui
      ChatManager$BuddyRenderer.getListCellRendererComponent
      1. ui.ChatManager$BuddyRenderer.getListCellRendererComponent(ChatManager.java:84)
      1 frame
    3. Java RT
      EventDispatchThread.run
      1. javax.swing.plaf.basic.BasicListUI.updateLayoutState(BasicListUI.java:1344)
      2. javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState(BasicListUI.java:1294)
      3. javax.swing.plaf.basic.BasicListUI.getPreferredSize(BasicListUI.java:561)
      4. javax.swing.JComponent.getPreferredSize(JComponent.java:1634)
      5. javax.swing.ScrollPaneLayout.layoutContainer(ScrollPaneLayout.java:769)
      6. java.awt.Container.layout(Container.java:1421)
      7. java.awt.Container.doLayout(Container.java:1410)
      8. java.awt.Container.validateTree(Container.java:1507)
      9. java.awt.Container.validate(Container.java:1480)
      10. javax.swing.RepaintManager.validateInvalidComponents(RepaintManager.java:669)
      11. javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:124)
      12. java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
      13. java.awt.EventQueue.dispatchEventImpl(EventQueue.java:642)
      14. java.awt.EventQueue.access$000(EventQueue.java:85)
      15. java.awt.EventQueue$1.run(EventQueue.java:603)
      16. java.awt.EventQueue$1.run(EventQueue.java:601)
      17. java.security.AccessController.doPrivileged(Native Method)
      18. java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
      19. java.awt.EventQueue.dispatchEvent(EventQueue.java:612)
      20. java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
      21. java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
      22. java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
      23. java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
      24. java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
      25. java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
      25 frames