Allows the user to enter a string in a dialog box. Returns "" if the user cancels the dialog box.
(String prompt, String defaultString)
| 975 | /** Allows the user to enter a string in a dialog box. Returns |
| 976 | "" if the user cancels the dialog box. */ |
| 977 | public static String getString(String prompt, String defaultString) { |
| 978 | GenericDialog gd = new GenericDialog(""); |
| 979 | gd.addStringField(prompt, defaultString, 20); |
| 980 | gd.showDialog(); |
| 981 | if (gd.wasCanceled()) |
| 982 | return ""; |
| 983 | return gd.getNextString(); |
| 984 | } |
| 985 | |
| 986 | /**Delays 'msecs' milliseconds.*/ |
| 987 | public static void wait(int msecs) { |
no test coverage detected