B4J Question Implementing jFX.DirectoryChooser

Fr Simon Rundell

Member
Licensed User
Longtime User
Hello, I need to implement a Directory Chooser, which appears to be a part of the jFX Library

https://www.b4x.com/b4j/help/jfx.html#directorychooser

Unfortunately, I can't seem to see it nor instantiate it. I realise I have missed soemthing really obvious, but I can't see it. I tried to force it with

B4X:
Dim dlg As JFX.DirectoryChooser
dlg.InitialDirectory="C:\User\"
dlg.Initialise
txtSaveLocation.Text=dlg.Show(MainForm)

but, obviously this was wrong.

Thank you in anticipation.
 

DonManfred

Expert
Licensed User
Longtime User
Try DirectoryChooser

B4X:
    Dim dirchoose As DirectoryChooser
    dirchoose.Initialize
    If InitialOpenPath = "" Or Not(File.Exists(File.GetFileParent(InitialOpenPath), "")) Then
        InitialOpenPath = File.DirApp
    End If
    dirchoose.InitialDirectory = InitialOpenPath
    dirchoose.Title = "Set Folder to bla bla bla"
    dirchoose.Show(MainForm)
 
Upvote 0

Fr Simon Rundell

Member
Licensed User
Longtime User
Try DirectoryChooser

B4X:
    Dim dirchoose As DirectoryChooser
    dirchoose.Initialize
    If InitialOpenPath = "" Or Not(File.Exists(File.GetFileParent(InitialOpenPath), "")) Then
        InitialOpenPath = File.DirApp
    End If
    dirchoose.InitialDirectory = InitialOpenPath
    dirchoose.Title = "Set Folder to bla bla bla"
    dirchoose.Show(MainForm)

Yes, obvious now I see what you are doing. Thank you very much.
 
Upvote 0
Top