JTable.setRowHeight prevents me from adding more rows
Posted
by Brent Parker
on Stack Overflow
See other posts from Stack Overflow
or by Brent Parker
Published on 2010-03-30T15:41:38Z
Indexed on
2010/03/30
15:43 UTC
Read the original article
Hit count: 362
I'm working on a pretty simple Java app in order to learn more about JTables, TableModels, and custom cell renderers. The table is a simple table with 8 columns only with text in them. When you click on an "add" button, a dialog pops up and lets you enter the data for the columns.
Now to my problem. One of the columns (the last one) should allow for multiple lines of text. I'm already putting HTML into the field, but it is not wrapping. I did some research and looked into JTable#setRowHeight(). However, once I use setRowHeight, I can no longer add rows to the table. The data is put into the table model, but it does not show in the table. If I remove the setRowHeight line, then it adds data just fine.
Is there another step to adding data to my data model that I'm missing?
Thanks a lot!
© Stack Overflow or respective owner