天天看点

[jtable]设置第一列不可编辑

public boolean isCellEditable(int rowIndex, int columnIndex) {  
			//第一列不可编译
			if(0 <= rowIndex && rowIndex < getRowCount() && columnIndex == 0){
				return false;
			}else{
				return true;
			}

或者

public boolean isCellEditable(int rowIndex, int columnIndex) {  
			//第一列不可编译
			if(0 <= rowIndex && rowIndex < getRowCount() && columnIndex == 0){
				return false;
			}else{
				return true;
			}



//设置第一行不可编辑

public boolean isCellEditable(int rowIndex, int columnIndex) {
			if (columnIndex == 0) {
				return false;
			}
			return true;
		}

//希望对jtable有困惑人帮助
           

继续阅读