Two or more rows in a JTable cell?

How to place two or more rows in one JTable cell? I tried adding '\ n' to the end of the line, but it does not work.

+3
source share
2 answers

Try using HTML

<html>lineOne <br/> lineTwo </html>
+4
source

As additional information: HTMl works because the default rendering for JTable is JLabel, the HTML performance in JTable is actually not very good, so if you notice performance problems after using a lot of HTMl, then it’s good to choose makign better

http://ckw.phys.ncku.edu.tw/public/pub/src/HTML/Languages/Java/Swing/swingHTML/Chapter27.htm , ,

+3

Source: https://habr.com/ru/post/1782899/


All Articles