Java JOptionPane Confirmation confirm(String msg)

Here you can find the source of confirm(String msg)

Description

Mnenomic for JOptionPane#showConfirmDialog(Component,Object)

License

Open Source License

Parameter

Parameter Description
question a parameter

Return

true if OK

Declaration

public static boolean confirm(String msg) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import javax.swing.JOptionPane;

public class Main {
    /**//from  w  w w .  j a va 2s.c  o m
     * Mnenomic for {@link JOptionPane#showConfirmDialog(Component, Object)}
     * 
     * @param question
     * @return true if OK
     */
    public static boolean confirm(String msg) {
        int opt = JOptionPane.showConfirmDialog(null, msg);
        return opt == JOptionPane.OK_OPTION;
    }
}

Related

  1. confirm(final Component component, final String title, final String message)
  2. confirm(String message)
  3. confirm(String message)
  4. confirm(String message, boolean typeYesNo)
  5. confirm(String message, String title)
  6. confirm(String title, Object message, JComponent parent)
  7. confirmAction(Component comp, String title, String msg)
  8. confirmarEliminar(Component component, String titulo, String mensaje)
  9. confirmationBox(String msg, String title)