Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/398.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何在Excel中检索单元格的颜色?_Java_Apache Poi - Fatal编程技术网

Java 如何在Excel中检索单元格的颜色?

Java 如何在Excel中检索单元格的颜色?,java,apache-poi,Java,Apache Poi,我尝试了很多可能性。但我无法找到确切的颜色。 Apache POI版本:4.0.1 下面是一些例子 row.getCell(0).getCellStyle().getFillBackgroundXSSFColor().getARGBHex() 输出:每种颜色为空 row.getCell(0).getCellStyle().getFillBackgroundColor() 输出:每种颜色64 row.getCell(0).getCellStyle().getFillForegroundColo

我尝试了很多可能性。但我无法找到确切的颜色。 Apache POI版本:4.0.1

下面是一些例子

row.getCell(0).getCellStyle().getFillBackgroundXSSFColor().getARGBHex()
输出:每种颜色为空

row.getCell(0).getCellStyle().getFillBackgroundColor()
输出:每种颜色64

row.getCell(0).getCellStyle().getFillForegroundColor()
输出:0

row.getCell(0).getCellStyle().getFillBackgroundColorColor()
输出:org.apache.poi.xssf.usermodel。XSSFColor@4813bcba

row.getCell(0).getCellStyle().getFillForegroundColorColor()

输出:org.apache.poi.xssf.usermodel。XSSFColor@c04a46bb

Selenium与excel无关。您好,Ramakarishna,请检查
行的结果有什么问题。getCell(0)。getCellStyle()。getFillBackgroundColorColor()
?是不是颜色不对?@SteffenJacobs我不确定这是什么(org.apache.poi.xssf.usermodel)。XSSFColor@4813bcba)颜色是。请尝试
.getRGB()
而不是
.getARGB()