There is setEditable(boolean b) method in JTree class.
But I can't found the similar method in
JTable, JTextField, etc.
I don't want user edit the cells in my JTable or JTextField.
How do I do that?
Thank_Q very much in advance()!
> There is setEditable(boolean b) method in JTree class.
> But I can't found the similar method in
> JTable, JTextField, etc.
>
> I don't want user edit the cells in my JTable or JTextField.
> How do I do that?
JTextField has setEditable. It's inherited from JTextComponent.
For JTable, use a TableModel that always returns false from
isCellEditable. (Or extend JTable and override its isCellEditable.) For
tables, using TableModel is usually the way to go.
Tom Hawtin
[Followup-To: comp.lang.java.gui]
RC - 24 May 2007 14:50 GMT
> JTextField has setEditable. It's inherited from JTextComponent.
>
> For JTable, use a TableModel that always returns false from
> isCellEditable. (Or extend JTable and override its isCellEditable.) For
> tables, using TableModel is usually the way to go.
Thank Q very very much!