POI 3.10版本样式设置更新问题

2022年7月28日 0 作者 小渔民

旧——>新:

style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND)------>
style.setFillPattern(FillPatternType.SOLID_FOREGROUND);

style.setBorderBottom(HSSFCellStyle.BORDER_THIN)------>
style.setBorderBottom(BorderStyle.THIN);

style.setBorderLeft(HSSFCellStyle.BORDER_THIN)------>
style.setBorderLeft(BorderStyle.THIN);

style.setBorderRight(HSSFCellStyle.BORDER_THIN)------>
style.setBorderRight(BorderStyle.THIN);

style.setBorderTop(HSSFCellStyle.BORDER_THIN)------>
style.setBorderTop(BorderStyle.THIN);

titleStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER_SELECTION)// 水平居中------>
titleStyle.setAlignment(HorizontalAlignment.CENTER)

titleStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 垂直居中------>
titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);

titleFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);// 设置粗体------>
titleFont.setBold(true);

原文链接:https://blog.csdn.net/MaxVelika/article/details/104860193