Compilable source can be found at: http://www.splashcd.com/jtable.tar
I'm new to the language, so I'm not sure if this is acceptable behavior or not.
I created a JTable to display a row for each message received (it receives about one every 20 seconds). One of the table columns can contain a large amount of text, so I created a custom cell renderer which word wraps and sets the row height accordingly.
All that works as expected, except that once the table displays its first row, it calls the cell renderer about ten times a second... until the user closes the table.
Once I get approx 20 rows in there, the table gets fairly sluggish, taking 2-8 seconds to resize a column, scoll up or down, or render a selected row with the selected background color.
I inserted a print statement inside the renderer, so I can see how many times the getTableCellRendererComponent method is being called.
I disabled tool tips, and disabled all cell editing. I do have a listener that scrolls the view to the last row when either a new row is added or the table is resized.
Should the getTableCellRendererComponent method be called several times a second when I'm just viewing the screen (not touching mouse or keyboard)?
TIA