如何向NetBeams jTable添加自动行计数

时间:2017-01-21 08:15:53

标签: java count jtable row

NetBeams jTable的默认代码如下所示:

    jTable1.setModel(new javax.swing.table.DefaultTableModel(
        new Object [][] {
            { new Integer(1), "Name1", "Description1"},
            { new Integer(2), "Name2", "Description2"}
        },
        new String [] {
            "Number", "Name", "Description"
        }
    ) {
        Class[] types = new Class [] {
            java.lang.Integer.class, java.lang.Object.class, java.lang.Object.class
        };

        public Class getColumnClass(int columnIndex) {
            return types [columnIndex];
        }
    });

但是如何插入自动行数呢?

0 个答案:

没有答案