테이블모델 Tip

import javax.swing.table.*;
public class Table_Model extends AbstractTableModel{
String[] colHead;
Object[][] data;
public Table_Model(String[] str, Object[][] data){
colHead = str;
this.data = data;
}
public int getColumnCount(){
return colHead.length;
}
public int getRowCount(){
return data.length;
}
public String getColumnName(int col){
return colHead[col];
}
public boolean isCellEditable(int row, int col){
return true; //false 이면 셀수정안됨
}
public Object getValueAt(int row, int col){
return data[row][col];
}
public void setValueAt(Object value, int row, int col) {
data[row][col] = value;
fireTableCellUpdated(row, col);
}
}

트랙백

이 글과 관련된 글 쓰기 (트랙백 보내기)
TrackbackURL : http://happy2ni.egloos.com/tb/2837881 [도움말]

덧글

덧글 입력 영역


문화꽃 키우기