<AWT Dev> RFE: Windows awt FileDialog in JDK9

Semyon Sadetsky semyon.sadetsky at oracle.com
Fri Mar 11 07:57:17 UTC 2016

On 3/11/2016 10:26 AM, Hendrik Schreiber wrote:
>> On Mar 10, 2016, at 09:54, Semyon Sadetsky <semyon.sadetsky at oracle.com> wrote:
>> On 3/10/2016 10:22 AM, Hendrik Schreiber wrote:
>>>> On Mar 10, 2016, at 07:26, Semyon Sadetsky <semyon.sadetsky at oracle.com> wrote:
>>>> In my opinion the switching to old/new file dialog should be presented in more explicit way. The automatic fallback may cause unexpected behavior. May be it is worth to introduce a new system property to regulate the file dialog version.
>>> Hey Semyon,
>>> I don’t have any strong feelings regarding an implicit switch or using a system property.
>>> Assuming the user has set the system property to use the new dialog (old dialog as default), what do you suggest should happen when the user calls setFilenameFilter()?
>> the best what is reachable with the selected version and the platform API.
> The best that’s reachable with a plain vanilla FilenameFilter would be to throw an exception. That’s why I suggested that FileTypeFilter in one of my previous mails: To offer at least some filter functionality while maintaining compatibility.
I meant that at least try to convert filter to file types. May be throw 
exception if it is not possible. Unchecked exception may not be a good 
choice for this. FilenameFilter you've proposed is a good design 
solution but the final decision is up to engineer who will implement the 
bug fix.
>> But the default should be the most functional version i.e. GetOpenFileName.
> Agreed.
>> Yet another trouble is the IFileDialog returns a shell item while AWT dialog expects a path string. It s not always possible to convert shell folder to a f/s path string which can be correctly interpreted after.
> Just because I’m curious: What’s an example for such a shell folder that does not correspond to a f/s path?
It corresponds but it cannot be interpreted on the java side. One cannot 
do new File(path) with it. Look on the MS known folders. Libraries 
folder for example which content cannot be addressed using f/s path. I 
would not say that it is not possible but it will require much more 
efforts than adding the IFileDialog itself.

> -hendrik

More information about the awt-dev mailing list