Whats the preferred way to use native File chooser dialog on Compose desktop applications. `java.awt...
s
Whats the preferred way to use native File chooser dialog on Compose desktop applications.
java.awt.FileDialog
seems to be working fine. Is that the recommended way?
👀 5
i
For now we don't have any other way to open native File chooser. So feel free to use it if it works fine 🙂
👍 1
s
@Igor Demin thanks!
m
@suresh could you paste a code snippet how you show that dialog from compose?
s
Copy code
import java.awt.*

...

val dialog = FileDialog(null as Frame?, "Select File to Open")
dialog.mode = FileDialog.LOAD
dialog.isVisible = true
val file: String? = dialog.file
println("$file chosen.")
@Mantas Varnagiris ^ this is what i am using
m
Great! thanks for quick response 🙏
1067 Views