draw in jpanel using values input in textbox
I am learning core JAVA and I am doing a project on "My Paint Application".
I am facing trouble while using the values from a textbox to draw using paintComponent. the paint page has buttons for "line", "arc" and other shapes, and has a jpanel which is defined in another class.
when the user clicks on "line" button, for example, a dialog opens, where the user inputs the coordinates required for drawing a line. I have accepted the input, but i do not understand how to use this input to draw on the jpanel that is inserted in my paint page.
Can anyone please help me with this? I'm stuck up with it.
I have attached some of my code for reference.