Returning value from JDialog; dispose(), setVisible(false) - example
问题 I know, that this question appears quite frequently in SO like here: but I would like to present some very specific example... I'm simply not sure if I make things right. I've got a JDialog in which I can type some values, select some checkboxes... whatever... I've got also some Response object created in MyDialog which represents the MyDialog's "answer". In JFrame which calls/creates JDialog: MyDialog d = new MyDialog(this, ...); d.showDialog(); // After MyDialog is closed (it's modal):