Search code examples
directorydefaultnetbeans-8

How to change the default Open File... (folder) in Netbeans 8.2?


How can I change the default Open File... directory in Netbeans 8.2 for Java SE\ME\EE?
I've edited my projectui.properties file line projectsFolder=DIRECTORY but that only works for projects. I am trying to open individual files without opening the entire project. File was found (Windows) under "C:\Users\MYNAME\AppData\Roaming\NetBeans\8.2\config\Preferences\org\netbeans\modules"


Solution

  • Unlike setting the default project directory in NetBeans, you can't modify the default Open File... directory because there is no such "default directory" to change.

    NetBeans behavior when you select Open File... from the File menu (on Windows 10 at least) is as follows:

    [1] On the first occasion within a NetBeans session the Documents icon will be pre-selected in the Open dialog window, and your Documents directory will be opened. That's just the way NetBeans works, and cannot be modified. Although you can change the Documents folder that will be opened, you probably shouldn't. See below for details**.

    [2] Within the Open dialog you can obviously navigate to any alternative folder to open a file. Thereafter, within that NetBeans session only, that alternative folder will be opened by default on the subsequent File -> Open File... selections, until an alternative directory is selected.

    ~~~~~

    ** To change the Documents folder in Windows (which will also change the folder that NetBeans opens on the initial use of File -> Open File..):

    • In Windows File Explorer select Desktop -> This PC -> Documents and right-click.

    • Select Properties from the drop down menu, and then select the Location tab in the Document Properties window.

    • Enter the name of the new folder to be used as the Documents folder and click OK.

    • Restart NetBeans, select File-> Open File... and the folder NetBeans opens will now be the one you specified in the previous step.

    That may appear to have the desired affect, but other Windows applications also use the Documents folder, and may depend on files in that folder, so it shouldn't really be changed without good reason. If you really need to open files in NetBeans that are not within any project the cleanest approach would be to place such files in the Documents folder if possible.