jtable如何获取整列数据

2024-11-04 19:29:45

1、创建一个工程test,在里面创建“Jtable_test”。

jtable如何获取整列数据

3、运行后获得的是一个这样的hello表格,两行三列的表格。

jtable如何获取整列数据

5、然后通过getRowCoutn、与getValueAt遍历输出列2中的所有数据,并输出。int coln=2;for(int i=0;i<table.getRowCount();i++){ Object onecell= table.getValueAt(i,coln); System.out.println(onecell);}

jtable如何获取整列数据
猜你喜欢