JTable and TableColumnModel

From: Rene Ruppert (rene.ruppert_at_o2online.de)
Date: 10/22/04


Date: Fri, 22 Oct 2004 14:36:04 +0200

Hi,

I try to implement my own TableColumnModel for JTable.
The problem is that I cannot resize or move the headers by using the mouse.
All I get is an exception (see below).
What am I missing? I don't want to post the whole code here, that's way too
much.
The headers and the contents of the table are displayed correctly but as I
said: resizing or moving is not possible. There doesn't even appear a ghost
drag image of the column header when trying to move it.

Any hints?

     [java] Exception in thread "AWT-EventQueue-0"
java.lang.NullPointerException
     [java] at javax.swing.JTable.getCellRenderer(JTable.java:3876)
     [java] at
javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:1644)
     [java] at
javax.swing.plaf.basic.BasicTableUI.paintDraggedArea(BasicTableUI.java:1620)
     [java] at
javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:1575)
     [java] at
javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:1470)
     [java] at javax.swing.plaf.ComponentUI.update(ComponentUI.java:142)
     [java] at
javax.swing.JComponent.paintComponent(JComponent.java:740)
     [java] at javax.swing.JComponent.paint(JComponent.java:1003)
     [java] at
javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4930)
     [java] at
javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4883)
     [java] at
javax.swing.JComponent._paintImmediately(JComponent.java:4826)
     [java] at
javax.swing.JComponent.paintImmediately(JComponent.java:4633)
     [java] at
javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:451)
     [java] at
javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.runSystemEventQueueUtilities.java:114)
     [java] at
java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
     [java] at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
     [java] at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
     [java] at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
     [java] at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
     [java] at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
     [java] at
java.awt.EventDispatchThread.run(EventDispatchThread.java:110)