2017-03-06 97 views
0

我试图如何更改该行的网格线颜色?

IConfigLabelAccumulator cellLabelAccumulator = new IConfigLabelAccumulator() { 
    @Override 
    public void accumulateConfigLabels(LabelStack configLabels, int columnPosition, int rowPosition) { 
     int rowIndex = bodyDataLayer.getRowIndexByPosition(rowPosition); 
     if (rowIndex == 2) { 
      configLabels.addLabel("FOO"); 
     } 
    } 
}; 
bodyDataLayer.setConfigLabelAccumulator(cellLabelAccumulator); 
natTable.getConfigRegistry().registerConfigAttribute(CellConfigAttributes.GRID_LINE_COLOR, GUIHelper.COLOR_GREEN, DisplayMode.NORMAL, "FOO"); 

,但没有成功。 我该如何做到这一点?谢谢!

+0

你的问题是什么,更多描述添加到问题 –

回答

0

无法更改单行的网格线颜色。您只能对整个网格进行更改。唯一的方法是通过IOverlayPainter进行覆盖。

+0

谢谢!我会试试看。 – Joe