Java JOptionPane Message getInput(String msg, String defaultInput)

Here you can find the source of getInput(String msg, String defaultInput)

Description

get Input

License

Open Source License

Declaration

public static String getInput(String msg, String defaultInput) 

Method Source Code

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

import javax.swing.JOptionPane;

public class Main {
    public static String getInput(String msg, String defaultInput) {
        // msg = something like: "Please enter the MTP directory, e.g., '/sdcard/Music'"

        String input = (String) JOptionPane.showInputDialog(msg, defaultInput);

        return input;

    }/*from ww  w.  j a  va2  s  .com*/

    public static String getInput(String msg, String[] options, String defaultInput) {
        // msg = something like: "Please enter the MTP directory, e.g., '/sdcard/Music'"

        String input = (String) JOptionPane.showInputDialog(null, msg, "Please select an option",
                JOptionPane.PLAIN_MESSAGE, null, options, defaultInput);
        return input;

    }
}

Related

  1. excMsg(String msg, Exception ex)
  2. excMsg(String msg, Exception ex)
  3. excMsg(String msg, Throwable t)
  4. exibeMsg(String msg, int tipoMsg)
  5. getIconForType(int messageType)
  6. getInt(String message, int min, int max, Integer initialValue)
  7. getIntegerFromImput(String message, int min, int max)
  8. getIntegerInput(String message)
  9. getJOptionPaneIcon(int jOptionPaneMessageType)