Setting custom font color for XSSFWorkbook in Apache POI
问题 I'm having a little trouble with setting a custom font color for an XSSFWorkbook from Apache POI . When I do: yellow = workbook.createCellStyle(); Font whiteFont = workbook.createFont(); whiteFont.setColor(new XSSFColor(new Color(255, 255, 255)).getIndexed()); yellow.setFillForegroundColor(new XSSFColor(yellowRGB)); yellow.setFillPattern(XSSFCellStyle.SOLID_FOREGROUND); yellow.setFont(whiteFont); The font stays black, I'm not sure what I'm doing wrong though. 回答1: You can do whiteFont