I’m trying to add the finishing touches to an application I’ve been developing and I’d really like it so my fileChooser sets the current directory as the area in which you can select which drive to start from. I’ve looked at the Windows 7 path for this area and it seems to just be called ‘Computer’. I’ve tried entering this into the space where “C:\” is in the below code but that doesn’t work.
fileChooser.setCurrentDirectory(new java.io.File("C:\\"));
Does anyone know what you would enter to have it so the user first selects which drive to open from?
Well, the problem is that what is called “Computer” in Windows, is not really a folder, just behaves like one. It’s just a special way Windows use to display the most common folders (like C:, D:, Documents etc.), just to make the user’s life easier.
I’m not sure how you can achieve what you want, but i think this might help you:
link