Apache poi excel - 如何从样式索引中获取样式的名称

时间:2015-04-08 08:16:36

标签: java apache-poi

当我尝试使用apache poi检查样式是否存在时,我只获得样式的索引。检查完样式后,我想显示特定样式的名称。谁能帮我?提前谢谢..

示例

checkStyle = 2
if(currentStyle != checkStyle)
"Left Align Not Present"
else
"Left Align Present"

这是我的代码

if(row?.getCell(curColOp)?.getCellStyle()?.getIndex() == tcOpRow?.getCell(curColOp)?.getCellStyle()?.getIndex()){
   style.setFillForegroundColor(IndexedColors.RED.getIndex())
   style.setFillPattern(CellStyle.SOLID_FOREGROUND)
   row?.getCell(curColOp).setCellStyle(style)
}        

0 个答案:

没有答案