Ayfri
11/30/2021, 6:12 AMMutableState<String>
? I have pretty much all steps done but I don't know how to create a Folder selector ? (I know there is java.awt.FileDialog but I can't find anywhere how to select folders with it)eygraber
11/30/2021, 7:47 AMval chooser = JFileChooser()
chooser.fileSelectionMode = JFileChooser.DIRECTORIES_ONLY
val returnVal = chooser.showOpenDialog(frame)
if(returnVal == JFileChooser.APPROVE_OPTION) {
frame.dispose()
currentDirectory = chooser.selectedFile
} else {
currentDirectory = null
}
Ayfri
11/30/2021, 1:16 PMframe
?eygraber
11/30/2021, 2:18 PMeygraber
11/30/2021, 2:19 PMval frame = JFrame().apply {
defaultCloseOperation = JFrame.EXIT_ON_CLOSE
val screenBounds = graphicsConfiguration.bounds
val x = (screenBounds.width - width) / 2 + screenBounds.x
val y = (screenBounds.height - height) / 2 + screenBounds.y
setLocation(x, y)
isVisible = true
}
Ayfri
11/30/2021, 2:40 PMeygraber
11/30/2021, 4:47 PMUIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName())
it's almost the sameAyfri
11/30/2021, 7:05 PM