poi BorderStyle
时间: 2023-12-17 16:59:22 浏览: 291
poi BorderStyle是Apache POI库中的一个枚举类型,用于表示单元格边框的样式。它包括以下常量:
- BORDER_NONE:无边框
- BORDER_THIN:细边框
- BORDER_MEDIUM:中等边框
- BORDER_DASHED:虚线边框
- BORDER_DOTTED:点状边框
- BORDER_THICK:粗边框
- BORDER_DOUBLE:双线边框
- BORDER_HAIR:细直线边框
- BORDER_MEDIUM_DASHED:中等虚线边框
- BORDER_DASH_DOT:点划线边框
- BORDER_MEDIUM_DASH_DOT:中等点划线边框
- BORDER_DASH_DOT_DOT:双点划线边框
- BORDER_MEDIUM_DASH_DOT_DOT:中等双点划线边框
- BORDER_SLANTED_DASH_DOT:斜点划线边框
这些常量可以用于设置单元格边框的样式。例如,可以使用以下代码将单元格的边框设置为粗边框:
```
CellStyle style = workbook.createCellStyle();
style.setBorderTop(BorderStyle.BORDER_THICK);
style.setBorderBottom(BorderStyle.BORDER_THICK);
style.setBorderLeft(BorderStyle.BORDER_THICK);
style.setBorderRight(BorderStyle.BORDER_THICK);
cell.setCellStyle(style);
```
阅读全文