I’m developing a Java GUI in which users have to select an output directory. I want to use JFileChooser to do the file selection, but I’m concerned about OS compatibility. My GUI has to function on Windows, Mac, and Linux, so I want to know if JFileChooser will use appropriate path syntax on those three platforms (i.e. JFileChooser will separate directories with ‘\’ on Windows and ‘/’ on UNIX). If JFileChooser isn’t OS-specific, what syntax does it use to describe a path?
Share
JFileChooser automatically starts on the appropriate directory for each OS (
C:/for windows, I believe the user library for macs, and the corresponding directory for Linux). Because of this, the JFileChooser is usable on all Operating Systems, as common sense suggests.If this were not the case, and JFileChooser was not compatible on all OS’s, then most likely it would not be an easily accessible part of java, and would have corresponding counterparts for the other operating systems.