public static void removeCols(JTable paymentTable) {

        TableColumnModel tcm = paymentTable.getColumnModel();
        System.out.println("getColumnCount:" + tcm.getColumnCount());

        if (tcm.getColumnCount() == 7) {
            paymentTable.removeColumn(tcm.getColumn(6));
        }
        if (tcm.getColumnCount() == 6) {
            paymentTable.removeColumn(tcm.getColumn(5));
        }

        if (tcm.getColumnCount() == 5) {
            paymentTable.removeColumn(tcm.getColumn(4));
        }
    }