Цвет заливки в ячейке hssf
Я добавил фон, как показано ниже. Все остальные изменения видны в Excel, но ячейка не заполняется цветом. пожалуйста помоги
public static CellStyle getWeeklyHeaderStyle(HSSFWorkbook wb) {
CellStyle cellStyle = wb.createCellStyle();
cellStyle.setWrapText(true);
cellStyle.setAlignment((short) 1);
cellStyle.setVerticalAlignment((short) 1);
cellStyle.setBorderLeft((short) 1);
cellStyle.setBorderRight((short) 1);
cellStyle.setBorderTop((short) 1);
cellStyle.setBorderBottom((short) 1);
getPalette(wb);
cellStyle.setFillBackgroundColor(IndexedColors.RED.getIndex());
cellStyle.setFont(getFont(wb));
return cellStyle;
}
public static HSSFPalette getPalette(HSSFWorkbook wb) {
HSSFPalette palette = wb.getCustomPalette();
// replacing the standard red with freebsd.org red
palette.setColorAtIndex(IndexedColors.RED.index, (byte) 204, (byte) 204,
(byte) 255);
return palette;
}