public void paint(Graphics g){
      if (environment != null) {
          Sudoku env = (Sudoku) environment;
          Board board = env.getBoard();

          int n = SudokuLanguage.DIGITS;
          int sqrt_n = (int) (Math.sqrt(n) + 0.1);

          g.setColor(Color.lightGray);
          Font font = g.getFont();
          g.setFont( new Font(font.getName(), font.getStyle(), 20 ));
          for (int i = 0; i<n; i++) {
              int ci = getCanvasValue(i);
              if (i % sqrt_n == 0) {
                  g.drawLine(ci, DRAW_AREA_SIZE + MARGIN, ci, MARGIN);
                  g.drawLine(DRAW_AREA_SIZE + MARGIN, ci, MARGIN, ci);
              }

              for (int j = 0; j < n; j++) {
                  int cj = getCanvasValue(j);
                  int value = board.get(i, j);
                  if( value > 0 ){
                      g.setColor(Color.black);
                      g.drawString(""+value, cj+CELL_SIZE/5, ci+CELL_SIZE);
                      g.setColor(Color.lightGray);
                  }
              }

          }
          g.drawLine(DRAW_AREA_SIZE + MARGIN, DRAW_AREA_SIZE + MARGIN, DRAW_AREA_SIZE + MARGIN, MARGIN);
          g.drawLine(DRAW_AREA_SIZE + MARGIN, DRAW_AREA_SIZE + MARGIN, MARGIN, DRAW_AREA_SIZE + MARGIN);
      }
  }