Draw lines between components

Does anyone know how I can draw lines between the textfields?
If I ask for x and y then this is relative to the component itself.. Also now I have made a separate class but this means that when I draw the lines the textfields disappear they cannot exist at the same time...