/** * Shows the dialog. Overrides shall call {@code super.show()} at the end. * * @return the identifier of the last button pressed or zero if this is a modeless dialog. */ public int show() { setButtonID(0); if (!shown) { dialog.pack(); center(); } dialog.setVisible(true); shown = true; return getButtonID(); }