B4J Question FileChooser options

yo3ggx

Active Member
Licensed User
Longtime User
Hello,

There is any way to make FileChooser to return the full path to the selected file (or a new file) without displaying any message?
If I use ShowOpen, I am not allowed to enter a new file name (I get the message that the file does not exist).
If I use ShowSave and choose an existing file, I am asked if I want to override it, which is not the case as I want to load it.

Thank you.
 

yo3ggx

Active Member
Licensed User
Longtime User
Then there is any other possibility to achieve this in B4J without building my own File Chooser?
 
Upvote 0

Didier9

Well-Known Member
Licensed User
Longtime User
Yes, this is a bit annoying.
This is what I do in my apps when the user wants to save something (through a menu entry or a button): the app creates a unique file name that includes a date and/or time stamp, so that I can be reasonably assured that the file name will be unique, and I place the fully qualified file name in a text box that the user can click to cut and paste into Explorer or other software. I typically place that file in the User's AppData folder "C:\Users\<user>\AppData\Roaming" since that is a place that I know B4J can write to.

It's a little clumsy but apparently my users got used to that pretty quickly.

It is quite frustrating that this folder is hidden by default under Windows, so it is hard to navigate to with Explorer, but the trick above does help.
 
Upvote 0

yo3ggx

Active Member
Licensed User
Longtime User
I need something a little bit different. If an existing file is selected in FileChooser, then that file will be further used. If a new file name entered, the new file will be used. So ... half Open, half Save. For the moment I keep Save, even if when an existing file is selected I get a message that the file will be overwritten, which is not the case (just used).
 
Upvote 0
Top