【发布时间】:2017-04-02 12:20:58
【问题描述】:
示例数据: 这是我在 jtable 中的 2 行
[john, carter, post, add]
[smith, sale, col, late]
for (int count = 0; count < dataModel.getRowCount(); count++){
data.add(dataModel.getValueAt(count, 0).toString());
}
System.out.println(data);
当我运行这段代码时,我得到了输出:
[john, smith]
我的问题是如何打印整行而不仅仅是第一列。 所以输出应该是:
[john, carter, post, add]
【问题讨论】: