In my code i want to change the cell colors of a particular column of a HSSFWorkbook, if the text is "PASS". But when i was writing the code, lots of methods and constants like BRIGHT_GREEN.index, setFillPattern, SOLID_FOREGROUND are deprecated. I have searched for an alternative in Apache POI official website, but the code given there is also deprecated. I know there is no problem if i mention @deprecation tag, but sometimes after 100-150 lines(rows), cell-color is not changing. Can anyone please tell me is there any alternative to avoid @deprecation? FYI: i am using poi-bin-3.17-beta1-20170701 jars. Thanks in advance :)
if(cell.getStringCellValue().equalsIgnoreCase("Pass")){
HSSFCellStyle style = workbook.createCellStyle();
style.setFillForegroundColor(HSSFColor.BRIGHT_GREEN.index);
style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
cell.setCellStyle(style);
}