我想一個單元格的背景顏色設置爲這樣如何將單元格的背景顏色設置爲任何RGB值?
XSSFCellStyle instructionStyle = wb.createCellStyle();
instructionStyle.setWrapText(true);
XSSFColor myColor = new XSSFColor(new java.awt.Color(0, 73,144));
instructionStyle.setFillForegroundColor(myColor);
instructionStyle.setAlignment(HorizontalAlignment.CENTER);
的RGB值,甚至將其編譯的是水平對齊一邊向中央有一個小區的look.can有人告訴我,沒有其他作用此代碼有什麼問題?謝謝
請參見[快速指南填充和顏色](https://poi.apache.org/spreadsheet/quick-guide.html#Fills+and+colors)。請注意設置[CellStyle.setFillPattern](https://poi.apache.org/apidocs/org/apache/poi/ss/usermodel/CellStyle.html#setFillPattern%28org.apache.poi.ss.usermodel.FillPatternType% 29)。所以對於實際的'apache poi'版本:'instructionStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);'。 @ apache-poi:更新你的快速指南! –