Originally posted by gaya3
of a JLabel and JLabels don't interpret '\n' characters at all so your three string
parts all end up on one line. A silly trick would be to feed the JLabel (actually
the renderer) an html string; something like this:
[code=java]
String columnFromDB= "apple orange strawberry";
columnFromDB= columnFromDB.re placeAll(" ", "<br>");
columnFromDB= "<html>"+column FromDB+"</html>";
[/code]
This code snippet effectively turns this:
"apple orange strawberry"
into this:
"<html>apple<br >orange<br>stra wberry</html>"
and it will be rendered as three lines but it will still be one single column value.
kind regards,
Jos
Comment