1
我要的颜色3个不同的列集合与3种不同的颜色,这种方法被用于添加颜色:java中,无法色彩细胞合适的颜色,Apache的POI
public static void addCellStyles(CellStyle stylex, CellStyle styley, CellStyle stylez){
stylex.setFillBackgroundColor(IndexedColors.LIGHT_GREEN.getIndex());
stylex.setFillPattern(CellStyle.SOLID_FOREGROUND);
stylex.setAlignment(CellStyle.ALIGN_CENTER);
stylex.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
styley.setFillBackgroundColor(IndexedColors.LIGHT_ORANGE.getIndex());
styley.setFillPattern(CellStyle.SOLID_FOREGROUND);
styley.setAlignment(CellStyle.ALIGN_CENTER);
styley.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
stylez.setFillBackgroundColor(IndexedColors.LIGHT_CORNFLOWER_BLUE.getIndex());
stylez.setFillPattern(CellStyle.SOLID_FOREGROUND);
stylez.setAlignment(CellStyle.ALIGN_CENTER);
stylez.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
}
我指定该CellStyles到各个小区中由于某种原因,在细胞被染成黑色的主要功能 ,我似乎无法找到任何问题 谁能帮助我
谢谢bro完美地工作 – Anish6595