0

It's possible to display HTML in a JTable cell:

Displaying HTML in a JTable

I use this to display multiple lines of text in a cell. But how do I get the required dimensions of the text that I want to render? With Swing, I can use FontMetrics to get the dimensions of a string that I wish to write, but what can I use for HTML?

486DX2-66
  • 129
  • 2
  • 10
  • Invoke the renderer of the cell. Check out: https://stackoverflow.com/questions/31977754/how-do-i-make-a-jtable-column-size-exactly-or-closely-fit-contents/31977776#31977776. I demonstrates how to determine the maximum width of a column by invoking the renderer for all cells in a column. – camickr Aug 10 '21 at 18:48

0 Answers0