62,615
社区成员
发帖
与我相关
我的任务
分享
package com.swoky.model;
import javax.swing.table.AbstractTableModel;
/**
* @author swoky
* @[E-mail]:wangyong8625@126.com [Msn] :swoky@hotmail.com
*/
public class QueueTableModel extends AbstractTableModel {
/*
* 返回列数
*/
public int getColumnCount() {
return 1000;
}
/*
*表头名
*/
public String getColumnName(int columnIndex) {
return String.valueOf(columnIndex);
}
/*
* 返回行数
*/
public int getRowCount() {
return 1000;
}
public Object getValueAt(int rowIndex, int columnIndex) {
return columnIndex==0 ? columnIndex : 这里用随机;
}
}
然后
...
table = new JTable(model);