Java JOptionPane Confirmation confirmUserChoiceWithCustomOptions(final Component sourceComponent, final String question, final String defaultOption, final String... options)

Here you can find the source of confirmUserChoiceWithCustomOptions(final Component sourceComponent, final String question, final String defaultOption, final String... options)

Description

confirm User Choice With Custom Options

License

Open Source License

Declaration

public static int confirmUserChoiceWithCustomOptions(final Component sourceComponent, final String question,
            final String defaultOption, final String... options) 

Method Source Code


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

import java.awt.Component;

import javax.swing.*;

public class Main {
    public static int confirmUserChoiceWithCustomOptions(final Component sourceComponent, final String question,
            final String defaultOption, final String... options) {
        final int selectedOption = JOptionPane.showOptionDialog(sourceComponent, question, "CONFIRM",
                JOptionPane.OK_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, defaultOption);
        return selectedOption;
    }// w  ww .  j a  v  a  2s  . com
}

Related

  1. confirmChangeReference(boolean isChangingProject)
  2. confirmDialog(Component owner, String title, String message)
  3. confirmDialog(String msg, String title)
  4. confirmDialogWorker(Component owner, String title, String message, ModalityType modalityType, int option)
  5. ConfirmMessage(String strMsg)
  6. confirmWindow(String title, String message)
  7. displayConfirm(Component parent, String message, String title, int optionType, int messageType)
  8. displayConfirmPane(String desc, String title)
  9. getConfirmation(Component parent, String str)