Java JTable - 连续添加按钮

时间:2016-09-12 18:36:44

标签: java swing jtable

似乎iam试图在我的JTable行中获得一个按钮,但没有任何帮助。有人可以帮忙吗?

public void buildTable() {
    try {
        rsmt = rs.getMetaData();
        int c = rsmt.getColumnCount();
        column = new Vector(c);
        for (int i = 1; i <= c; i++) {
            column.add(rsmt.getColumnName(i));
        }
        column.add("Delete");
        data = new Vector();
        row = new Vector();
        while (rs.next()) {
            row = new Vector(c);
            for (int i = 1; i <= c; i++) {
                // I also want to generate a Button here...
                row.add(rs.getString(i));

            }

            data.add(row);
        }
    } catch (Exception e) {

    }
}

0 个答案:

没有答案