YoussefGamil Posted October 11, 2005 Posted October 11, 2005 Hi,I really need your help...It's in setting a Jtable editable(false);....I mean to make a jtable where you can't edit what is wriiten in it.
Stalkie Posted October 15, 2005 Posted October 15, 2005 After a quick look in the docs, the easiest method I can see is this:Create a TableModel, where you only override isEditable to always return falseimport javax.swing.table.TableModel;public class UneditableTableModel extends TableModel{ public boolean isEditable(int rowIndex, int columnIndex) { return false; }}Then when you create your JTableJTable table = new JTable(new UneditableTableModel());And no, I have not tested this, but it should work :-)
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now