On Thu, 12 Mar 2026 16:20:50 GMT, Dmitry Markov <[email protected]> wrote:

>> The following methods in FileChooser class: showOpenDialog, 
>> showOpenMultipleDialog and showSaveDialog throw IllegalArgumentException if 
>> initialDirectory does not exist or is not a directory or is not accessible. 
>> This can result in a poor user experience so callers should validate 
>> initialDirectory or fall back to a safe default before showing the dialog.
>> 
>> Proposed fix:
>> If this directory is not set, does not exist, is not a directory or is not 
>> accessible the dialog will fall back to the platform-default location. The 
>> default folder may be different across operating systems. Update the 
>> specification of FileChooser class to clarify new behaviour.
>
> Dmitry Markov has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Fixed typo

modules/javafx.graphics/src/main/java/javafx/stage/FileChooser.java line 209:

> 207:      * The initial directory for the displayed file dialog.
> 208:      * <p>
> 209:      * If this directory is not set, does not exist, is not a directory, 
> or is not accessible,

"If this directory... is not a directory" sounds a bit odd. Maybe replace the 
first "directory" with "path"?

modules/javafx.graphics/src/main/java/javafx/stage/FileChooser.java line 212:

> 210:      * the dialog will fall back to the platform-default location. The 
> default folder may vary
> 211:      * across operating systems.
> 212:      * </p>

We usually omit the closing `</p>`.

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/2101#discussion_r2926205788
PR Review Comment: https://git.openjdk.org/jfx/pull/2101#discussion_r2926210797

Reply via email to