Predefined Form Painter

Xiao Bian then this one says, If you let Gerry table cell surface may save other non-string object (using predefined drawing and editor), we need to expand the TableModel to create your own spreadsheet models
are as follows:

在这里插入代码片
public class my extends DefaultTableModel{

public my(Object [][]a,Object[]b) {
	super(a,b);
}
public Class getColumnClass (int c) {
	return getValueAt(0,c).getClass();
}
public boolean isCellEditable(int a,int b) {//决定单元格是否可以编辑
	return getColumnClass(b)!=ImageIcon.class;
}
}
Published 141 original articles · won praise 16 · views 30000 +

Guess you like

Origin blog.csdn.net/feiqipengcheng/article/details/105185459