利用poi设置背景颜色时,应如下配置,

CellStyle cell=workbook.createCellStyle();
cell.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
cell.setFillPattern(FillPatternType.SOLID_FOREGROUND);

而下是下方的set方法

cell.setFillBackgroundColor(IndexedColors.GREY_25_PERCENT.getIndex());

下面是颜色相关参数,可供参考 

 

  

posted on 2019-02-13 21:24  小白coder  阅读(7868)  评论(0编辑  收藏  举报