Drawing Lines using looping statements
First of all, I hope that I've posted on the correct section/thread. Moving on, I would like to seek help from anyone here. As you can see, I'm new to Java programming and I'm only using books to support my study (self-study). And, I can say that I'm slowly grasping the logic and concept of Java. But, I've encountered this problem, and here it is.
This design draws lines from the top-left corner, fanning out the lines until they cover the upper-left half of the panel. One approach is to divide the width and height into an equal number of steps (we found 15 steps worked well). The first endpoint of a line will always be in the top-left corner (0,0). The second endpoint can be found by starting at the bottom-left corner and moving up one vertical step and moving right one horizontal step. Draw a line between the two endpoints. Continue moving up and to the right one step to find each successive endpoint. The figure should scale accordingly as you resize the window.
The result should look like this.
I've been trying to do this for the past 2 weeks but up until now I haven't solved this problem.
Hope anyone can here can share tips on how to do this. I'm not actually asking for the exact code (since I would still want to do this on my own). But, I'm asking for at least a hint/clue on how to do this. Maybe, just a code snippet will help and from there I would do it on my own.