Here you can find the source of getStringInput(String message)
public static String getStringInput(String message)
//package com.java2s; /**// w w w . j av a 2 s . co m * You should have received a copy of the GNU General Public License version 3 * along with this work; Please find the Copyright information and Terms and * Conditions in the ClientLauncher.java or ServerLauncher.java file. */ import javax.swing.JOptionPane; public class Main { public static String getStringInput(String message) { String input; while (true) { input = (String) JOptionPane.showInputDialog(null, message, ""); if (input != null && input.trim().length() != 0) break; } return input; } public static String getStringInput(String message, String initialValue) { String input; while (true) { input = (String) JOptionPane.showInputDialog(null, message, initialValue); if (input != null && input.trim().length() != 0) break; } return input; } }