Package javax.swing

Examples of javax.swing.JOptionPane.createDialog()


  public static void showErrorDialog(String title, String msg) {
    Component parent = Mediator.getUI().getComponent();

    JOptionPane pane = new JOptionPane(msg, JOptionPane.ERROR_MESSAGE,
        JOptionPane.OK_CANCEL_OPTION);
    JDialog dialog = pane.createDialog(parent, title);
    dialog.setVisible(true);

    // Turn off the wait cursor, in case it's enabled.
    parent.setCursor(null);
  }
View Full Code Here


      Throwable e) {
    String msg = e.getClass().getName() + ": " + e.getLocalizedMessage();

    JOptionPane pane = new JOptionPane(msg, JOptionPane.ERROR_MESSAGE,
        JOptionPane.OK_CANCEL_OPTION);
    JDialog dialog = pane.createDialog(parent, title);
    dialog.setVisible(true);

    e.printStackTrace();

    // Turn off the wait cursor, in case it's enabled.
View Full Code Here

    String msg = e.getClass().getName() + ": " + e.getLocalizedMessage();

    JOptionPane pane = new JOptionPane(msg, JOptionPane.ERROR_MESSAGE,
        JOptionPane.OK_CANCEL_OPTION);
    JDialog dialog = pane.createDialog(parent, title);
    dialog.setVisible(true);

    e.printStackTrace();

    // Turn off the wait cursor, in case it's enabled.
View Full Code Here

        while (true) {
            JOptionPane optionPane = new JOptionPane
                (new Object[] { message, inputField },
                 JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION,
                 null, options);
            optionPane.createDialog(parentComponent, title).setVisible(true);

            button = optionPane.getValue();
            if (!OK.equals(button))
                return null;    // user cancel
View Full Code Here

        GT._("No to all"),
    };
    JOptionPane pane = new JOptionPane(
        message, JOptionPane.WARNING_MESSAGE,
        JOptionPane.YES_NO_OPTION, null, options);
    JDialog dialog = pane.createDialog(parent, Version.PROGRAM);
    dialog.setVisible(true);
    Object selectedValue = pane.getValue();
    if (selectedValue == null) {
      return JOptionPane.CLOSED_OPTION;
    }
View Full Code Here

                super.displayError(message);
            } else {
                JOptionPane pane =
                    new JOptionPane(message, JOptionPane.ERROR_MESSAGE);
                JDialog dialog =
                    pane.createDialog(JSVGCanvas.this, "ERROR");
                dialog.setModal(false);
                dialog.setVisible(true); // Safe to be called from any thread
            }
        }
View Full Code Here

            if (debug) {
                System.err.println(message);
            }
            JOptionPane pane =
                new JOptionPane(message, JOptionPane.ERROR_MESSAGE);
            JDialog dialog = pane.createDialog(JSVGViewerFrame.this, "ERROR");
            dialog.setModal(false);
            dialog.setVisible(true);
        }

        /**
 
View Full Code Here

    /**
     * Displays an error message.
     */
    public void displayError(String message) {
        JOptionPane pane = new JOptionPane(message, JOptionPane.ERROR_MESSAGE);
        JDialog dialog = pane.createDialog(parentComponent, "ERROR");
        dialog.setModal(false);
        dialog.setVisible(true);
    }

    /**
 
View Full Code Here

            Strings.get("replaceExtensionKeepOpt")
          };
        JOptionPane dlog = new JOptionPane(msg);
        dlog.setMessageType(JOptionPane.QUESTION_MESSAGE);
        dlog.setOptions(options);
        dlog.createDialog(proj.getFrame(), ttl).setVisible(true);
       
        Object result = dlog.getValue();
        if (result == options[0]) {
          String name = old.substring(0, ext0) + circExt;
          f = new File(f.getParentFile(), name);
View Full Code Here

                   
                    JPasswordField pwd = new JPasswordField("");
                    String label = "Please input passphrase for the PKCS#12 certificate:";
                    Object[] objArray = {label, pwd};
                    JOptionPane pane = new JOptionPane(objArray, JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION);
                    JDialog dialog = pane.createDialog(View.getSingleton().getMainFrame(), "Passphrase");
                    dialog.setVisible(true);
                    int result = ((Integer) pane.getValue()).intValue();
                    if (result != JOptionPane.OK_OPTION) {
                        return;
                    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.