5.4.3 Other Grid Properties

Grid Colors

It is possible to set grid line's colors using enumeration GridPaintTags.

Setting grid colors for horizontal lines:

1
2
3
4
//sets only horizontal lines
Grid grid = new Grid (new PlaneMapper2D(), null, yMapper);
//sets color for grid
grid.getPaintStyle().setBackground(GridPaintTags.HORIZONTAL, new Color(220,220,220));

Grid Colors Demonstration

Figure 5.4.3.1 Grid Colors Demonstration