How can I get the absolute path of a directory using JFileChooser, just selecting the directory?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
Try:
fullPath gives you the required Absolute path of the Selected directory
Use:
together with:
then call
getAbsoluteFile()
on theFile
object returned.JFileChooser
'sgetSelectedFile()
method, returns aFile
object. Use thegetAbsolutePath()
to get the absolute name to the file.modified example from the javadoc: