one of the ways: include a method in the dialog to return the selection (object, int, whatever). make the dialog modal, so the method does not return until the dialog closes [object?] selection = new dialog(name).getSelection();
I got your point. but how can I make the model that way ? and the options are just buttons! (should I also, do smthing like that at the end of the action of the buttons: System.exit(1))