Unable to set fill background color for certain cell using RGB value in apache POI

Charlie Zeng picture Charlie Zeng · Dec 26, 2012 · Viewed 23.4k times · Source

I'm using XSSF in Apache POI to generate Xlsx file. I imported org.apache.poi.xssf.usermodel.XSSFColor. My purpose is to set fill background color to RGB(141,180,226) for certain cell. I tried using

XSSFColor bg=getXSSFColor("8DB4E2");

to get the codes for the color first. Then use,

setFillBackgroundColor(bg) 

to set the color. However, method getXSSFColor cannot be found. I don't know why and if there is other to achieve the same purpose.

Answer