Restrict to allowed extensions
parent
96135cfc40
commit
e781783c7b
|
@ -163,6 +163,7 @@ fun app() {
|
|||
fun selectFile(extensions: Set<String>, onFileSelected: (String) -> Unit) {
|
||||
val fileDialog = FileDialog(Frame(), "Select a file", FileDialog.LOAD)
|
||||
fileDialog.isMultipleMode = false // To enable selecting only one file
|
||||
fileDialog.file = "." + extensions.joinToString(";.")
|
||||
fileDialog.isVisible = true
|
||||
|
||||
val selectedFile = fileDialog.file
|
||||
|
|
Loading…
Reference in New Issue