1

I'm developing an application using JavaFX and I have to use a DirectoryChooser. I'm calling it through the following code:

 DirectoryChooser chooser = new DirectoryChooser();
 chooser.setInitialDirectory(new File("~/Downloads/"));
 chooser.initialDirectoryProperty();
 chooser.setTitle("JavaFX Projects");

 Button browse = new Button("Browse");
 browse.addEventHandler(MouseEvent.MOUSE_CLICKED,
            new EventHandler<MouseEvent>() {
                @Override
                public void handle(MouseEvent e) {
                     File  file=chooser.showDialog(MyStage);

                    if (file != null) {

                     downloadPath.setText(file.getPath());

                    }

                }
            });

On Mac OS X DirectoryChooser opens, but it doesn't set customized title and the app isn't blocked by it, I can still use it and open other DirectoryChooser dialogs.

On Windows systems the same code works perfectly, both title setting and app blocking.

Thanks for your help :-)

2
  • Try using a java 8 preview release and see if your issue is fixed.
    – jewelsea
    Jan 9, 2013 at 18:00
  • On release JDK 8 (1.8.0_60-b27) the title is still not shown. Grrrrrr Jan 7, 2016 at 22:05

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.