How do I change the header font color to white and the fill green? These are the classes that I am using:
import static org.apache.poi.ss.usermodel.CellStyl
If you want to set the color as simple cellstyle... you can write code like.
cell.setCellValue("Header Text");
XSSFCellStyle headerStyle = wb.createCellStyle();
Font headerFont = wb.createFont();
headerStyle.setFillForegroundColor(IndexedColors.GREEN.getIndex());
headerFont.setColor(IndexedColors.WHITE.getIndex());
headerStyle.setFillPattern(CellStyle.SOLID_FOREGROUND);
headerStyle.setFont(headerFont);
cell.setCellStyle(headerStyle);
This will fill the cell with GREEN color and the font will be of Bold WHITE color