Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to set the initial directory

866629Oct 30 2011 — edited Oct 30 2011
Using the FileChooser in JavaFX 2.0. How do you correctly set the initial directory?

In Swing you would do the following:
JFileChooser Choose = new JFileChooser();
Choose.setCurrentDirectory(new File("."));
But in JavaFX:
Choose.setInitialDirectory(new File("."));
does not work and causes JavaFX to bomb out when this code is triggered.

Edited by: 863626 on 30-Oct-2011 05:30
This post has been answered by shakir.gusaroff on Oct 30 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 27 2011
Added on Oct 30 2011
1 comment
1,287 views