java 设置Excel单元格颜色
// 创建单元格颜色 HSSFCellStyle cellstyle = (HSSFCellStyle) workbook.createCellStyle(); cellstyle.setFillPattern(SOLID_FOREGROUND); cellstyle.setFillForegroundColor(HSSFColorPredefined.LIME.getIndex()); // 获取Color所在列的下标 int colorID = cellNameCellNum.get(wr.getColor()); Cell colorCell=row.createCell(colorID); colorCell.setCellStyle(cellstyle);
cellstyle.setFillForegroundColor(HSSFColorPredefined.LIME.getIndex());报错原因