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
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now