给单元格设置了一个批注:
Comment comment = cell.getSheet().createDrawingPatriarch().createCellComment(new XSSFClientAnchor(0, 0, 0,0, (short) 3, 3, (short) 5, 6));
// 输入批注信息
comment.setString(new XSSFRichTextString(value));
// 添加作者,选中B5单元格,看状态栏
comment.setAuthor("toad");
// 将批注添加到单元格对象中
cell.setCellComment(comment);
然后使用了shiftRows批量下移单元格,设置批注的单元格也包含在下移的单元格中,结果最后下移之前这个位置的单元格,和下移之后位置的单元格都有了一个批注,但是内容是空的。
解决办法:在下移之后重新从sheet中获取移动之后的cell,再给单元格设置批注