How do I change the Text Color and the Fillcolor

后端 未结 3 576
被撕碎了的回忆
被撕碎了的回忆 2020-12-15 08:44

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         


        
3条回答
  •  被撕碎了的回忆
    2020-12-15 09:21

         HSSFCellStyle cellStyle = workBook.createCellStyle();        
         HSSFFont font = wb.createFont();
         font.setFontName(XSSFFont.DEFAULT_FONT_NAME);
         font.setFontHeightInPoints((short)10);
         font.setColor(IndexedColors.BLUE.getIndex());
         cellStyle.setFont(font);
        //the version i am using is poi-3.8
    

提交回复
热议问题