Hi, I'm using Jetpack Compose for desktop applicat...
# compose-desktop
s
Hi, I'm using Jetpack Compose for desktop application. How to choose folder (folder pick) ? please help me with a snippet of code
s
@Colton Idle In codeviewer project it is showing file tree I need folder chooser like we have in javaFx directoryChooser.showDialog(primaryStage)
i
There is an example, how to wrap java.awt.FileDialog into Composable. But is doesn't show a folder dialog, it shows a file dialog. To show a folder dialog you can probably use JFileChooser. I didn't check how it looks, but it has:
Copy code
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY)
JFileChooser is not a native dialog, it only mimics it. To open a truly native dialog you can use third-party libraries
s
I'm looking for native dialog, I will try the third-party libraries. Thank you