📄 mytablemodel.java~4~
字号:
package test_tree;
import javax.swing.table.AbstractTableModel;
public class MytableModel extends AbstractTableModel {
String []colname=new String[]{"名称","大小","时间"};
public int getColumnCount() {
return colname.length;
}
public String getColumnName(int columnIndex) {
return colname[columnIndex];
}
public int getRowCount() {
return 0;
}
/**
* Returns the value for the cell at <code>columnIndex</code> and
* <code>rowIndex</code>.
*
* @param rowIndex the row whose value is to be queried
* @param columnIndex the column whose value is to be queried
* @return the value Object at the specified cell
* @todo Implement this javax.swing.table.TableModel method
*/
public Object getValueAt(int rowIndex, int columnIndex) {
return null;
}
/**
* Returns the most specific superclass for all the cell values in the
* column.
*
* @param columnIndex the index of the column
* @return the common ancestor class of the object values in the model.
* @todo Implement this javax.swing.table.TableModel method
*/
public Class getColumnClass(int columnIndex) {
return null;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -