2 Replies Latest reply: Feb 24, 2012 11:10 AM by 918508 RSS

    DirectoryChooser

    918508
      Hi,

      Let me say some words before asking my question:
      I am very impressed of JavaFX 2, building nice looking GUIs(or in other words: filthy rich clients) was never that easy. After 2 weekends of coding, programming with the JavaFX-API just feels good. Getting the same results with Swing needs a lot more code and a deep understanding of Swing internals. JavaFX looks so promising, even average GUI programmers like me are now able to create good looking GUI applications in an acceptable amount of time on the Java platform. Great job!

      So now to my question:
      I have a problem with DirectoryChooser. On my machine the dialog is opened, but not with the initial directory and title passed to the DirectoryChooserBuilder.
      It looks like these parameters are just ignored.

      Did i something wrong or is it a bug?

      System:
      Windows 7 (64-Bit)
      JavaFX 2.1 SDK
      JDK 1.7.0_02
      package javafx.test;
      
      import java.io.File;
      
      import javafx.application.Application;
      import javafx.scene.Group;
      import javafx.scene.Scene;
      import javafx.stage.DirectoryChooser;
      import javafx.stage.DirectoryChooserBuilder;
      import javafx.stage.Stage;
      
      public class Main extends Application {
      
           @Override
           public void start(Stage stage) {
                Scene scene = new Scene(new Group());
                stage.setScene(scene);
                stage.show();
      
                DirectoryChooser dc = DirectoryChooserBuilder.create().initialDirectory(new File("c:\\")).title("Directory chooser").build();
                dc.showDialog(scene.getWindow());
      
           }
      
           public static void main(String[] args) {
                launch(args);
           }
      }
      Edited by: user10124536 on 19-Feb-2012 08:50