No JFileChooser Documents/Desktop/Downloads access prompt in macOS 10.15 Catalina #85
Description
I'm submitting a…
- [] bug report
- [] feature request
- other
Short description of the issue/suggestion:
First, thank you for sharing your universalJavaApplicationStub. It enabled us to get Corelyzer running against Java 8+ on Mac.
Since using the stub, however, we've noticed an issue unique to macOS 10.15 Catalina. Bundled apps with the stub cannot access the Documents, Desktop, or Downloads folders through the JFileChooser. Unlike other apps, the macOS system prompt "[app] would like to access files in your Documents folder" introduced in macOS 10.15 Catalina does not automatically appear.
I'm not certain this is due to the stub, but I only see the behavior in bundled apps that use it. If it is not the stub, any guidance you can provide would be greatly appreciated.
I should also note that those dirs are accessible (without prompts) through FileDialog, which appears to use the native macOS chooser. That said, I'd like to understand and resolve the JFileChooser issue, if possible.
Steps to reproduce the issue/enhancement:
Build and run the sample app demonstrating the problem here:
https://github.com/sorghumking/catalinaFileChooserAccessTest
Or download and run the pre-built app here:
https://github.com/sorghumking/catalinaFileChooserAccessTest/releases
What is the expected behavior?
When attempting to access contents of the Documents, Desktop, or Downloads dir in JFileChooser, macOS should prompt "[app] would like to access files in your [folder name] folder".
What is the current behavior?
No prompt appears. The contents of the Documents, Desktop, and Downloads folders are not displayed.
Do you have screenshots, GIFs, demos or samples which demonstrate the problem or enhancement?
I've created a minimal sample app demonstrating the problem here:
https://github.com/sorghumking/catalinaFileChooserAccessTest
What is the motivation / use case for changing the behavior?
Again, am I uncertain universalJavaApplicationStub is the culprit, but it's the only common thread I can find in apps that exhibit this problem...your thoughts would be much appreciated.
Please tell us about your environment:
- universalJavaApplicationStub version: v3.0.6 (2020-03-19)
- Mac OS version: 10.15.4 (Catalina)
- Java version(s): 8 (also observed this problem in Java 11)