'How to make lines on Grid using canvas in JavaFX?

How to make lines on Grid using canvas in JavaFX?

How to make lines on Grid using canvas in JavaFX. Where I have a case study as follows:

I have a 10 x 10 grid, where each line will be formed according to the grid point, for example the starting point ([0, 0], [1, 0], [2, 0], [i, j])).

Example output:

Example Output

Also, I need to work on Canvas.

Thank you.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source