Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4509582

Changing row width on JTable occurs ClassCastException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 1.4.0
    • 1.4.0
    • client-libs
    • rc1
    • generic
    • generic
    • Verified

      Reproduction:

      - Extract the attached test case.
      - Execute the swing test case.
        % cd swingtest/classes
        % java SwingTest -command abc
      - Hold between 2 rows on swing.JTable test component and
        drag horizontally to change the row width.

      The following exception was thrown.

      java.lang.ClassCastException: javax.swing.JPanel
              at javax.swing.plaf.basic.BasicTableHeaderUI$MouseInputHandler.mouseDragged(BasicTableHeaderUI.java:146)
              at java.awt.AWTEventMulticaster.mouseDragged(AWTEventMulticaster.java:260)
              at java.awt.Component.processMouseMotionEvent(Component.java:5068)
              at javax.swing.JComponent.processMouseMotionEvent(JComponent.java:2790)
              at java.awt.Component.processEvent(Component.java:4823)
              at java.awt.Container.processEvent(Container.java:1383)
              at java.awt.Component.dispatchEventImpl(Component.java:3527)
              at java.awt.Container.dispatchEventImpl(Container.java:1440)
              at java.awt.Component.dispatchEvent(Component.java:3368)
              at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3219)
              at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2951)
              at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2866)
              at java.awt.Container.dispatchEventImpl(Container.java:1426)
              at java.awt.Window.dispatchEventImpl(Window.java:1568)
              at java.awt.Component.dispatchEvent(Component.java:3368)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
              at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:193)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:147)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:141)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:133)
              at java.awt.EventDispatchThread.run(EventDispatchThread.java:101)
      java.lang.ClassCastException: javax.swing.JPanel
              at javax.swing.plaf.basic.BasicTableHeaderUI$MouseInputHandler.mouseDragged(BasicTableHeaderUI.java:146)
              at java.awt.AWTEventMulticaster.mouseDragged(AWTEventMulticaster.java:260)
              at java.awt.Component.processMouseMotionEvent(Component.java:5068)
              at javax.swing.JComponent.processMouseMotionEvent(JComponent.java:2790)
              at java.awt.Component.processEvent(Component.java:4823)
              at java.awt.Container.processEvent(Container.java:1383)
              at java.awt.Component.dispatchEventImpl(Component.java:3527)
              at java.awt.Container.dispatchEventImpl(Container.java:1440)
              at java.awt.Component.dispatchEvent(Component.java:3368)
              at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3219)
              at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2951)
              at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2866)
              at java.awt.Container.dispatchEventImpl(Container.java:1426)
              at java.awt.Window.dispatchEventImpl(Window.java:1568)
              at java.awt.Component.dispatchEvent(Component.java:3368)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
              at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:193)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:147)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:141)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:133)
              at java.awt.EventDispatchThread.run(EventDispatchThread.java:101)
      java.lang.ClassCastException: javax.swing.JPanel
              at javax.swing.plaf.basic.BasicTableHeaderUI$MouseInputHandler.mouseDragged(BasicTableHeaderUI.java:146)
              at java.awt.AWTEventMulticaster.mouseDragged(AWTEventMulticaster.java:260)
              at java.awt.Component.processMouseMotionEvent(Component.java:5068)
              at javax.swing.JComponent.processMouseMotionEvent(JComponent.java:2790)
              at java.awt.Component.processEvent(Component.java:4823)
              at java.awt.Container.processEvent(Container.java:1383)
              at java.awt.Component.dispatchEventImpl(Component.java:3527)
              at java.awt.Container.dispatchEventImpl(Container.java:1440)
              at java.awt.Component.dispatchEvent(Component.java:3368)
              at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3219)
              at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2951)
              at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2866)
              at java.awt.Container.dispatchEventImpl(Container.java:1426)
              at java.awt.Window.dispatchEventImpl(Window.java:1568)
              at java.awt.Component.dispatchEvent(Component.java:3368)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
              at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:193)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:147)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:141)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:133)
              at java.awt.EventDispatchThread.run(EventDispatchThread.java:101)
      java.lang.ClassCastException: javax.swing.JPanel
              at javax.swing.plaf.basic.BasicTableHeaderUI$MouseInputHandler.mouseDragged(BasicTableHeaderUI.java:146)
              at java.awt.AWTEventMulticaster.mouseDragged(AWTEventMulticaster.java:260)
              at java.awt.Component.processMouseMotionEvent(Component.java:5068)
              at javax.swing.JComponent.processMouseMotionEvent(JComponent.java:2790)
              at java.awt.Component.processEvent(Component.java:4823)
              at java.awt.Container.processEvent(Container.java:1383)
              at java.awt.Component.dispatchEventImpl(Component.java:3527)
              at java.awt.Container.dispatchEventImpl(Container.java:1440)
              at java.awt.Component.dispatchEvent(Component.java:3368)
              at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3219)
              at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2951)
              at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2866)
              at java.awt.Container.dispatchEventImpl(Container.java:1426)
              at java.awt.Window.dispatchEventImpl(Window.java:1568)
              at java.awt.Component.dispatchEvent(Component.java:3368)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
              at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:193)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:147)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:141)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:133)
              at java.awt.EventDispatchThread.run(EventDispatchThread.java:101)
      java.lang.ClassCastException: javax.swing.JPanel
              at javax.swing.plaf.basic.BasicTableHeaderUI$MouseInputHandler.mouseDragged(BasicTableHeaderUI.java:146)
              at java.awt.AWTEventMulticaster.mouseDragged(AWTEventMulticaster.java:260)
              at java.awt.Component.processMouseMotionEvent(Component.java:5068)
              at javax.swing.JComponent.processMouseMotionEvent(JComponent.java:2790)
              at java.awt.Component.processEvent(Component.java:4823)
              at java.awt.Container.processEvent(Container.java:1383)
              at java.awt.Component.dispatchEventImpl(Component.java:3527)
              at java.awt.Container.dispatchEventImpl(Container.java:1440)
              at java.awt.Component.dispatchEvent(Component.java:3368)
              at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3219)
              at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2951)
              at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2866)
              at java.awt.Container.dispatchEventImpl(Container.java:1426)
              at java.awt.Window.dispatchEventImpl(Window.java:1568)
              at java.awt.Component.dispatchEvent(Component.java:3368)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
              at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:193)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:147)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:141)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:133)
              at java.awt.EventDispatchThread.run(EventDispatchThread.java:101)

      This problem is not reproducible on merlin beta2 (b77).

      ###@###.### 2001-10-02

            peytoia Yuka Kamiya (Inactive)
            kurosaki Kenichi Kurosaki (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: