I'm writing a GUI application in which the user is allowed to create a content for a table using a button. When the button is clicked, I want to have window popping up, where the user has to enter the number of steps and the step size, then either click OK or Cancel.
Should I make a new JFrame as the pop-up window or is there a better way?
In the programming perspective, how can I code my application so that the flow of the code stops and waits until the user has entered some values and pressed the OK button.
I mean like this:
private void GenerateTables(JTable Table) {
//StepAndSize is the pop-up window frame
StepsAndSize SandS = new StepsAndSize();
SandS.setVisible(true);
//...other codes
}
When I call the GenerateTables method, it will create a pop-up window, but as soon as the window is created it will continue to the next lines (other codes) but not waiting for the user to enter their values first.
Please help,
Thank you


Sign In
Create Account


Back to top










