我想在区域中添加条件格式,但是我在教程中看到的一种方法已经被弃用了。请问有什么替代方法。
ConditionalFormattingRule rule2 = sheetCF.createConditionalFormattingRule(ComparisonOperator.LT, "50");
PatternFormatting fill2 = rule2.createPatternFormatting();
fill2.setFillBackgroundColor(IndexedColors.GREEN.index);
fill2.setFillPattern(PatternFormatting.SOLID_FOREGROUND);
CellRangeAddress[] regions = {
CellRangeAddress.valueOf("A1:A6") //DEPRECATED
};
sheetCF.addConditionalFormatting(regions, rule);