public String getCellBackColor(int iRow, int iCol) throws Exception{
if (null == this.sheet){
throw new Exception("can't read any data:sheet is not exist!!!");
}
HSSFPalette palette = workBook.getCustomPalette();
HSSFCell cell = this.getCell(iRow, iCol);
HSSFColor hc = palette.getColor(cell.getCellStyle().getFillBackgroundColor());
return hc.getHexString();
}我这样写,hc 对像却总是为null,得到的颜色值为64或65
if (null == this.sheet){
throw new Exception("can't read any data:sheet is not exist!!!");
}
HSSFPalette palette = workBook.getCustomPalette();
HSSFCell cell = this.getCell(iRow, iCol);
HSSFColor hc = palette.getColor(cell.getCellStyle().getFillBackgroundColor());
return hc.getHexString();
}我这样写,hc 对像却总是为null,得到的颜色值为64或65
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货