POI中背景颜色设置方法如下:
HSSFCellStyle cellStyle = wb.createCellStyle();
cellStyle.setFillBackgroundColor(HSSFColor.TEAL.index); //设置背景色
cellStyle.setFillForegroundColor(HSSFColor.TEAL.index);// 设置前景色
cellStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
附:HSSFColor颜色对照表
---------------------
作者:麦田
来源:CSDN
原文:https://blog.csdn.net/itmyhome1990/article/details/49816405
版权声明:本文为博主原创文章,转载请附上博文链接!