java 设置Excel单元格颜色


 

 

            // 创建单元格颜色
                HSSFCellStyle cellstyle = (HSSFCellStyle) workbook.createCellStyle();
                cellstyle.setFillPattern(SOLID_FOREGROUND);
                cellstyle.setFillForegroundColor(HSSFColorPredefined.LIME.getIndex());
                //                获取Color所在列的下标
                int colorID = cellNameCellNum.get(wr.getColor());
                Cell colorCell=row.createCell(colorID);
                colorCell.setCellStyle(cellstyle);
 cellstyle.setFillForegroundColor(HSSFColorPredefined.LIME.getIndex());报错原因

 

 

 

 

 

 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM