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.
input
1 parent d629077 commit f75bc10Copy full SHA for f75bc10
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