No. The values in the variables are available to the rest of the code. Its a question of how to tell the code that wants to use the data that it is available. Perhaps you could start a Thread in the listener to do the connection when it gets the data. Its best to NOT do too much in a listener as the listener is using the GUI thread which means that your Menu items etc won't get responses while your code is using the GUIs thread.
The sequence of events: You create some text fields and add action listeners and then the user enters something in a text field. This triggers an action event that causes your listener to be called. The action listener gets the data from the text field and stores it in the variables you're looking at. Now the data in the variable is available to the rest of the program.