We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f65e99e + 9a7d156 commit ac5824dCopy full SHA for ac5824d
src/main/scala/introprog/Dialog.scala
@@ -23,9 +23,13 @@ object Dialog:
23
/** Show a dialog with a `message` text. */
24
def show(message: String): Unit = JOptionPane.showMessageDialog(null, message)
25
26
- /** Show a `message` asking for input with `init` value. Return user input.
+ /**
27
+ * Show a `message` asking for input with `init` value. Return user input.
28
*
- * Returns empty string on Cancel. */
29
+ * @param message prompt text displayed for user
30
+ * @param init intitial value displayed in input dialog
31
+ * @return user input, or an empty string on Cancel
32
+ */
33
def input(message: String, init: String = ""): String =
34
Option(JOptionPane.showInputDialog(message, init)).getOrElse("")
35
0 commit comments