Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AWT Folder Chooser?



Thank you! I was looking for that but couldn't find it anywhere, I knew someone here would know. :)

Alex.

On Wednesday, July 9, 2003, at 06:37 AM, Steve Roy wrote:

Alexandre Aybes <email@hidden> wrote:

I am trying to get a Folder Chooser preferably using the AWT file
chooser because the Swing File Chooser is just horrible. Is there any
hidden option to get the AWT FileChooser to select only folders?

Yes. Set the system property apple.awt.fileDialogForDirectories to true just
before showing the dialog, and then reset it.

FileDialog d = new FileDialog(parent, title, FileDialog.LOAD);
String prop = "apple.awt.fileDialogForDirectories";
System.setProperty(prop, "true");
d.show();
System.setProperty(prop, "false");

Personally I subclassed FileDialog and do the gymnastic above in the overriden
show() method.

Steve

--
Steve Roy <email@hidden>
Personal homepage: <http://homepage.mac.com/sroy>
Projects homepage: <http://www.roydesign.net>
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.