Код: Выделить всё
public showDialog(final Object caller) {
JDialog dialog = [ ... ]
if (caller instanceof Window) {
Window w = (Window) caller;
dialog.setLocationRelativeTo(w);
w.dispose();
}
}
< /code>
Тем не менее, есть ли однострочный способ сделать это? По сути, что -то вроде: (window) parent.dispose (); Подробнее здесь: https://stackoverflow.com/questions/121 ... n-one-line