回答
這似乎是不可能的。噓。這就是爲什麼最好的解釋:
http://osdir.com/ml/user-poi.apache.org/2009-03/msg00034.html
正如Alfabravo評論...現在它可能改變XSSFSheet標籤顏色。
sheet.setTabColor(int colorIndex)
用於這一點,所以如果我們使用
sheet.setTabColor(num);
NUM = 0:設置黑顏色的標籤。
num = 1:在標籤中設置白色。
num = 2:在選項卡中設置紅色。
num = 3:在選項卡中設置綠色。
num = 4:在選項卡中設置藍色。
num = 5:在選項卡中設置黃色。
等等。
顏色列表:https://poi.apache.org/apidocs/org/apache/poi/ss/usermodel/IndexedColors.html例如sheet.setTabColor(IndexedColor.BLACK.getIndex()) – Piotr 2014-06-11 09:06:48
正如評論說彼得,
在POI 3.11我的色彩標籤必須使用:
import org.apache.poi.ss.usermodel.IndexedColors;
sheet.setTabColor(IndexedColors.BLACK.getIndex());
(請注意,這是 「IndexedColor 小號」,而不是 「IndexedColor」 像顯示由彼得· )
這裏是一個顯示顏色的列表:http://jlcon.iteye.com/blog/1122538
不推薦使用setTabColor(int colorIndex)方法。一個應該使用setTabColor(XSSFColor顏色)。 'final XSSFSheet diffExpected = wbDiff.createSheet(refSheetName); diffExpected.setTabColor(new XSSFColor(Color.RED));' – ScarOnTheSky 2017-05-15 12:25:55
- 1. 使用apache poi將顏色應用於excel中的選項卡
- 2. Ionic2選項卡 - 如何更改選定選項卡的顏色?
- 3. 如何更改actionbarsherlock選項卡顏色和選項卡下的行的顏色?
- 4. 更改個別選項卡的顏色
- 5. Apache POI - 如何使用選項保護工作表?
- 6. 更改Android中的選項卡顏色
- 7. 更改選項卡選擇選項卡時的文本顏色
- 8. 更改「選項卡控件」顏色
- 9. 如何更改操作欄選項卡文本顏色
- 10. 如何在使用ViewPager滑動選項卡時更改選項卡指示符顏色和文本顏色?
- 11. 如何更改禁用的選項卡控件的顏色
- 12. 如何更改選項卡控件選項卡項目的標題顏色[MahApps.Metro]
- 13. 如何更改滑動選項卡中選定的選項卡顏色?
- 14. 更改選項卡布局選項卡顏色?
- 15. 更改選定選項卡上的sherlock動作欄選項卡文本顏色
- 16. 如何更改TabControl中選定選項卡的顏色?
- 17. 如何更改活動/選定選項卡的顏色?
- 18. 如何更改tablayout中選定選項卡的顏色?
- 19. 如何更改TabLayout選定選項卡的圖標顏色?
- 20. 我如何更改jtabbedpane選定的選項卡背景顏色
- 21. 如何爲ActionbarTab更改選定的選項卡顏色或字體顏色?
- 22. 更改Excel中最後4個Excel工作表的選項卡顏色(VBA)
- 23. Flex TabNavigator選項卡顏色不工作
- 24. ActionBarSherlock更改選項卡文本顏色的方向更改
- 25. 如何在選擇時更改顏色選項卡
- 26. 使用javascript更改html中的選項卡顏色
- 27. 通過顏色選項更改顏色
- 28. 如何添加更改選定選項卡的顏色的onclick動作?
- 29. 更改操作欄選項卡的背景顏色
- 30. 如何更改Android中以下3個選項卡的顏色?
請參閱[* Apache POI:常見問題*](http://poi.apache.org/faq.html#faq-N100BA)。 – trashgod 2012-08-25 00:43:47