Here you can find the source of getInput(String msg, String defaultInput)
public static String getInput(String msg, String defaultInput)
//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; } }