Using arrays to create a node and edge connector

i understand your point but i can just put the click amount to really high number such as 100000. well i guess i have to try to solve this with arraylist but still i dont understand how to connect with lines in both methods