So my question is, how do I make it so that the main class doesn’t run while another class is waiting for input from the user.
Maybe I’m thinking it the wrong way so please help me sort out my thoughts 🙂
Here is a little example/snippet.
Main Class is running a JFrame and then opens up another JFrame asking user for inputs
the other JFrame is inside AddEditWindow class.
AddEditWindow temp = new AddEditWindow();
info[counter+1] = temp.newEditedInfo;
infoArray.add(info[counter+1]);
So pretty much, what I’m asking is, how do I make it so that it doesn’t reach the 2nd line of code until the user finally finishes inputting everything.
The ActionListener/Event handler for AddEditWindow is just for a button.
So i’m waiting for a button to be clicked (so that the variable inside the AddEditWindow class is initialized) and then for the code to continue to
info[counter+1] = temp.newEditedInfo;
Hopefully I explained it well enough.
Don’t know if I’m thinking about it wrong or what 😐
For simplicity sake, try something like…
The
JOptionPaneis a very powerful component. If you supply a component instead of the string, it will display the component…For example…