How do I use the results of an action?
I'm trying to pass some information from user inputs back into my code but I don't really know how to go about it.
Basically, I'm making a Swing application that builds an XML file with a lot of repetitive lines and the idea is that the user will be able to input the unique values for each line, and the program will fill in the rest.
I have a dialog open with several text fields for the user to input information, once the user is done, I store the contents of these fields in a
The problem is, the information doesn't exist until the user presses the button, I don't know how to tell my code to "wait" until the button is pressed before continuing execution.
I guess I'm trying to use swing to make my own, more complicated
Basically, I'm making a Swing application that builds an XML file with a lot of repetitive lines and the idea is that the user will be able to input the unique values for each line, and the program will fill in the rest.
I have a dialog open with several text fields for the user to input information, once the user is done, I store the contents of these fields in a
List and then (after checking for bad input) use the List to create an object with the user data in the fields. I then need to add the toString of that object to the next line of my final output. The problem is, the information doesn't exist until the user presses the button, I don't know how to tell my code to "wait" until the button is pressed before continuing execution.
I guess I'm trying to use swing to make my own, more complicated
JOptionpane.showInputDialogue, where instead of returning a String it returns a list of Strings, but it still pauses execution until the strings are confirmed.