JFileChooser not seeing network mounted files on 1.7.0_06 on Mac
Paul Taylor
paul_t100 at fastmail.fm
Fri Aug 24 04:47:50 PDT 2012
On 24/08/2012 12:32, Anthony Petrov wrote:
> On 8/24/2012 3:29 PM, Paul Taylor wrote:
>>>> Well, j.a.FileDialog *is* a native file chooser dialog after all.
>>>> Maybe it's just missing a couple additional calls/styles that would
>>>> enable more native features.
>>>>
>>> No, because I'm really not clear if I'm doing something wrong here,
>>> and surely having a file dialog that has the functionality of the
>>> dialogs used by another applications is a long standing existing issue.
>>>
>>> The other thing Im confused about (in a good way) is that both
>>> FileDialog and JFileCHooser do seem to correct icons, i,e the
>>> applications folder contains a little blue A on the folder, whereas
>>> this post
>>> http://nadeausoftware.com/node/89#UsingtheJFileChoosertogetMacfileandfoldericons
>>> indicated JFileChooser does not.
>>>
>>> Paul
>>>
>> Sorry I did have something wrong, a messup in my source control, so
>> my latets code wasn't being run.
>> Now when using FIleDIalog it does display a native dialog , but I
>> want to be able to select folders not files, but it is not letting
>> me, Ive tried using
>>
>> System.setProperty("apple.awt.fileDialogForDirectories", "true");
>>
>> but seems to have no effect, is this option still supported ?
>
> This is fixed for 7u8 under CR 7161437.
>
> --
> best regards,
> Anthony
>
Thats good news , but I am in fact using 1.7.0_08-ea, is there later
version of 7u8 or am I using the fix wrong Im doing
System.setProperty("apple.awt.fileDialogForDirectories", "true");
FileDialog chooser = new FileDialog(MainWindow.frame);
chooser.setMode(FileDialog.LOAD);
chooser.setVisible(true);
String folderSelected = chooser.getDirectory();
System.setProperty("apple.awt.fileDialogForDirectories", "false");
File folder = new File(folderSelected) ;
if(folder.exists() && folder.isDirectory())
{
//DO something
}
Paul
More information about the macosx-port-dev
mailing list