This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
One consistent annoyance in NetBeans is that there are many dialogs and UIs which display JFileChoosers, but they are not handled consistently. For example, many usages of file choosers do not remember the last chosen directory when that UI was last used, so you click "Browse" once, and navigate some complicated directory structure to get to where you want; the next time you use the same UI you have to browse again. A more professional UI would be consistent about this sort of behavior, and it is easy to do. I am proposing a small API which would use NbPreferences to store the current directory based on unique keys provided by the client, makes use of JFileChoosers simpler, and also handles the case of badging files (needed for both platforms and projects - currently there are many copies of the same code to do this). This might ideally go into the Utilities API, as it is File-related, not FileObject-related. However, it needs access to FileUtil.preventFileChooserSymlinkTraversal(), so if we want this to go in Utilities, the FileUtil code should be moved there and the old version deprecated.
Created attachment 73522 [details] org.openide.filesystems.FileChooserBuilder
Alternate potential location for this, which would be intuitive, is the dialogs API - but we have the same problem of needing to add a dep on filesystems.
Please use the original issue. *** This issue has been marked as a duplicate of 47737 ***
Note, class in code is not final but should be.