5.8.3 Grid

GridPaintTags

These tags are used for setting formatting Grid objects. They can be applied either to the whole grid or its parts.

Tag Explanation
GridPaintTags.DEFAULTStyle for setting color for the whole grid
GridPaintTags.OUTLINE Style for setting line around the grid
GridPaintTags.VERTICAL Style for setting vertical grid lines color
GridPaintTags.HORIZONTAL Style for setting horizontal grid lines color

Table 5.8.3.1 GridPaintTags

Usage:

1
2
3
4
5
6
7
8
// sets grid's outline color
grid.getPaintStyle().setForeground(GridPaintTags.OUTLINE, new Color(169,174,137).darker());
// sets that line width
grid.getPaintStyle().setStroke(GridPaintTags.OUTLINE, new BasicStroke(2f));
// sets grid's paint mode
grid.getPaintStyle().setPaintMode(GridPaintTags.DEFAULT,PaintMode.FILL_PAINT);
// sets grid's background color
grid.getPaintStyle().setBackground(GridPaintTags.DEFAULT,new Color(169,174,137, 60));

GridPaintTags Demonstration

Figure 5.8.3.1 GridPaintTags Demonstration

View Source