Problem. I have a table. in which I am going added Cell element which are multi line. i.e say I add string "<html>mahesh<br>bogadi" to a cell. I wish to get it in multi line. Though the string appears in 2 lines the cell height does not increase so that I can see both the lines.
please suggest me to make the table cell size(width) dynmically adjustable to the number of lines in the string.
Also please suggest me how to make the table cells non-editable.
posted 12 years ago
please refer to sun's online java tutorial and JTable API. u need to write your own table cell renderer, in which you set the table cell's height for each cell according to it's content; also, u can overload JTable's "isCellEditable(row, col)" method to make it ineditable.