apple.awt.fileDialogForDirectories property not working.

niagarasoft20-macosxportdev at yahoo.com niagarasoft20-macosxportdev at yahoo.com
Mon May 28 09:52:16 PDT 2012


Anthony, this is fine, however, would it be possible to raise the level of importance of the request given the sandbox issue on the Mac and the larger number of users that it would affect resulting from the new mac platform requirements?

Right now the level is set to 4-Low. The bug 6927978 was initially submitted on 19-FEB-2010. Is there any hope that this will be implemented by Mac 10.8 release this summer?


Mike




>________________________________
> From: Anthony Petrov <anthony.petrov at oracle.com>
>To: Marco Dinacci <marco.dinacci at gmail.com> 
>Cc: macosx-port-dev Port OS X <macosx-port-dev at openjdk.java.net> 
>Sent: Monday, May 28, 2012 11:07 AM
>Subject: Re: apple.awt.fileDialogForDirectories property not working.
> 
>Hi Marco,
>
>This is a known issue: 7161437. Although it is closed as a duplicate of 
>a more general AWT RFE 6927978 that proposes to add public API for 
>DirectoryDialogs to AWT.
>
>--
>best regards,
>Anthony
>
>On 05/28/12 18:36, Marco Dinacci wrote:
>> Hi,
>>
>> the apple.awt.fileDialogForDirectories property is not honoured
>> neither with OpenJDK nor with Oracle JDK 7u4.
>> The following program will work with Java 6 but not with the above
>> mentioned distributions:
>>
>> import java.awt.FileDialog;
>> import java.io.File;
>> import javax.swing.JFrame;
>>
>> public class FileDialogTest extends JFrame {
>>
>>      public String selectFolder() {
>>          FileDialog fd = new FileDialog(this, "Select Folder Test",
>> FileDialog.LOAD);
>>          fd.setDirectory(System.getProperty("user.home"));
>>          fd.setLocation(50,50);
>>          fd.setVisible(true);
>>
>>          return fd.getFile();
>>      }
>>
>>      public static void main(String[] args) {
>>          System.setProperty("apple.awt.fileDialogForDirectories", "true");
>>
>>          FileDialogTest fdt = new FileDialogTest();
>>          String selectedFolder = fdt.selectFolder();
>>
>>          System.out.println("The selected file was: " + selectedFolder);
>>
>>          System.setProperty("apple.awt.fileDialogForDirectories", "false");
>>          System.exit(0);
>>      }
>>
>> }
>>
>> The expected result is to be able to select a directory, the actual
>> result is that the file chooser enter the directory.
>>
>> The Apple documentation states:
>>
>> By default, the AWT File Dialog lets you choose a file. Under certain
>> circumstances, however, it may be proper for you to choose a directory
>> instead. If that is the case, set this property to allow for directory
>> selection in a file dialog.
>>
>> The default value is false.
>>
>>
>> Shall I file a bug ?
>>
>> Best,
>> Marco
>
>
>


More information about the macosx-port-dev mailing list