Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Displaying HTML in a JTable

Can someone provide me with an example of how to display HTML in a cell of a JTable? I know this can be done for other Swing components but I can't seem to figure it out for JTables.

like image 680
Elliott Avatar asked Dec 22 '22 03:12

Elliott


1 Answers

Are you remembering to put <html> around the HTML markup as per <html>...</html>? The default string renderer in a JTable uses JLabel, so this should work. Just set the String as the cell value.

like image 114
Chris Dennett Avatar answered Dec 24 '22 02:12

Chris Dennett