-
-
Save seungdols/bd51bb66e2234aca6866 to your computer and use it in GitHub Desktop.
Prevent changing data of cell in JTable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Vector; | |
import javax.swing.table.DefaultTableModel; | |
public class CusDefaultTableModel extends DefaultTableModel { | |
@Override | |
public boolean isCellEditable(int row, int column) { | |
return false; | |
} | |
public CusDefaultTableModel() { | |
super(); | |
} | |
public CusDefaultTableModel(int rowCount, int columnCount) { | |
super(rowCount, columnCount); | |
} | |
public CusDefaultTableModel(Object[] columnNames, int rowCount) { | |
super(columnNames, rowCount); | |
} | |
public CusDefaultTableModel(Object[][] data, Object[] columnNames) { | |
super(data, columnNames); | |
} | |
public CusDefaultTableModel(Vector columnNames, int rowCount) { | |
super(columnNames, rowCount); | |
} | |
public CusDefaultTableModel(Vector data, Vector columnNames) { | |
super(data, columnNames); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment