+
+ /**
+ * Shows the dialog, and runs the response action if OK is selected
+ *
+ * @param action
+ */
+ public void showDialog(JComponent parent, String title, Runnable action)
+ {
+ String ok = MessageManager.getString("action.ok");
+ String cancel = MessageManager.getString("action.cancel");
+ String[] options = new String[] { ok, cancel };
+
+ JvOptionPane.newOptionDialog(parent)
+ .setResponseHandler(JvOptionPane.OK_OPTION, action)
+ .showInternalDialog(panel, title, JvOptionPane.OK_CANCEL_OPTION,
+ JvOptionPane.PLAIN_MESSAGE, null, options, ok);
+
+ /*
+ List<Runnable> actions = new ArrayList<>();
+ actions.add(action);
+ actions.add(JvOptionPane.NULLCALLABLE);
+
+ JvOptionPane.frameDialog(panel, title, JvOptionPane.PLAIN_MESSAGE,
+ options, ok, actions, false);
+ */
+ }