如何使用apache POI在单元格注释中添加新行字符

时间:2013-02-01 12:29:54

标签: java apache-poi

我需要在单元格注释中添加多行。如何使用apache POI打破单元格注释中的行

例如:

Comment = "This is comment 1";
comment = comment + "This is comment2";
comment = comment + "This is comment3";
cell.setCellComment(comment);

1 个答案:

答案 0 :(得分:5)

您可以使用\ n作为新行。

Comment = "This is comment 1";
comment = comment + "\n This is comment2";
comment = comment + "\n This is comment3";
cell.setCellComment(comment);