这是由于软件包org.apache.poi.ss.util不完整引起的。
PropertyTemplate以及
CellUtil和
RegionUtil仅基于
ss.usermodel级别而不是基于
xssf.usermodel级别。但是org.apache.poi.ss.usermodel.CellStyle
setFillForegroundColor(Colorcolor)到目前为止还不了解。它只知道
setFillForegroundColor(shortbg)。因此,直到现在,色阶
ss.usermodel根本无法设置
Color为填充前景色。仅
short(颜色索引)是可能的。
如果涉及一个问题,为什么当仅使用边框设置边框时为什么必须设置颜色,则
org.apache.poi.ss.util答案是有必要的,因为颜色和边框都相同
CellStyle。因此,将边框设置添加到时
CellStyle,必须保持颜色设置并最终将其设置为新颜色。
因此,总而言之,没有摆脱这种困境的方法。如果需要使用,
org.apache.poi.ss.util则不能同时使用
setFillForegroundColor(XSSFColorcolor)。唯一的希望是
setFillForegroundColor(Colorcolor)将
org.apache.poi.ss.usermodel.CellStyle在的更高版本中 添加到
apache poi。



