the problem is at your rowData setting.You set your rowData = {null, null, null, null, null}. 
As in the pre-input data, the last component is a type of boolean, 
there is a conflict between the row data and the pre-input data. You should set your rowData = {null, null, null, null, false};

解决方案 »

  1.   

    by the way, if you are not using jdk 5.0, you should set your 
    rowData = {null, null, null, null, new Boolean(false)};
      

  2.   

    I modified the code as you said,but the problem is still existent
      

  3.   

    setDefaultRenderer(getColumnClass(0), new CustomRowHeaderRenderer());
    很显然是这句话惹的祸,在你的代码里getColumnClass(0)取出来的是第0行第0列的数据的类型,明显是String,所以你只是为String类型加载了一个默认的Renderer,而你Insert以后,第0行第0列是null,它的类型不是String,所以Renderer被重载成系统默认的Renderer,你的Renderer自然就不生效了,要解决问题可以把上面的代码换成:
                getColumnModel().getColumn(0).setCellRenderer(new CustomRowHeaderRenderer());
    或者你
    Object[][] data = {
                { "Mary", "Campione", "Snowboarding", new Integer(5),
                        new Boolean(false) },
                { "Alison", "Huml", "Rowing", new Integer(3), new Boolean(true) },
                { "Kathy", "Walrath", "Knitting", new Integer(2),
                        new Boolean(false) },
                { "Sharon", "Zakhour", "Speed reading", new Integer(20),
                        new Boolean(true) },
                { "Philip", "Milne", "Pool", new Integer(10), new Boolean(false) } };
    里面的第一个"Mary"写成null也行,呵呵,不过估计这不是你想要的,开个玩笑  ^_^