// 創建單元格顏色 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());報錯原因