Skip to content

Commit f65e99e

Browse files
authored
Merge pull request #49 from EliasAAradsson/docs-improvements
Improve documentation for Dialog
2 parents af4e1c0 + d629077 commit f65e99e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/main/scala/introprog/Dialog.scala

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@ object Dialog:
66

77
Swing.init() // get platform-specific look and feel
88

9-
/** Show a file choice dialog starting in `startDir` with confirm `button` text. */
9+
/**
10+
* Show a file choice dialog starting in `startDir` with confirm `button` text.
11+
*
12+
* @param button the text displayed in this file choice dialog's confirm button
13+
* @param startDir the starting directory of this file choice dialog
14+
* @return the file path entered by user upon pressing confirm button,
15+
* an empty `String` if user pressed the file choice dialog's cancel button
16+
*/
1017
def file(button: String = "Open", startDir: String = "~"): String =
1118
val fs = new JFileChooser(new java.io.File(startDir))
1219
fs.showDialog(null, button) match

0 commit comments

Comments
 (0)