Home » excel » java – Apache POI 3.9 can not get HSSFPalette

java – Apache POI 3.9 can not get HSSFPalette

Posted by: admin May 14, 2020 Leave a comment

Questions:

I am using apache poi 3.9. I need to have a custom color in my excel.
On the apache documentation and some other suggestions there is a code:

Workbook wb = new HSSFWorkbook();
HSSFPalette palette = wb.getCustomPalette();

but Workbook does not have method getCustomPalette().
Please help me to find out how can I have a custom color on the cells

Thanks

How to&Answers:

Ok. I found it. should be:

HSSFWorkbook wb = new HSSFWorkbook();

instead of:

Workbook wb = new HSSFWorkbook();