Package javax.swing

Examples of javax.swing.JOptionPane.showOptionDialog()


    public static String getPasswordFromUser(JComponent parent)
    {
        JOptionPane j = new JOptionPane();
        JPasswordField pField = new JPasswordField();

        int ret = j.showOptionDialog(parent, pField, "Password required",
                                     JOptionPane.YES_NO_OPTION,
                                     JOptionPane.QUESTION_MESSAGE, null, null,
                                     null);

        return pField.getText();
View Full Code Here


    catch(NoPathFoundException e)
    {
      if (warnUser)
      {
        msg.showMessageDialog(this, "Je suis désolé, mais vous n'avez plus suffisamment de vie pour continuer.\nVous allez mourir ici...", "Mauvaise nouvelle", JOptionPane.WARNING_MESSAGE);
        int ans = msg.showOptionDialog(this, "Voulez-vous recommencer ?", "Redémarrer le niveau", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null);
        switch(ans)
        {
        case 0:
          throw(new RestartLevelException());
        case 1:
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.