JDK-8352298 : FileChooser: inconsistent behavior with setInitialName()
  • Type: Bug
  • Component: javafx
  • Sub-Component: window-toolkit
  • Affected Version: jfx23
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2025-03-18
  • Updated: 2025-03-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Description
To reproduce, launch the attached code sample.  Select the "txt" option via the combo box and presses the [Save] button, a FileChooser dialog is opened with setInitialFileName() and setInitialDirectory().  Additionally, the extension filters are set with a list in which the first filter corresponds to the selected type.

Observe the "Save As:" input field in the file chooser.

With the "txt" extension, "File" portion of the file name is selected, ".txt" portion is unselected (see the screenshot).

With the "rich" extension, on the other hand, the filename displayed becomes "File.rich.rich" with the "File.rich" portion selected, and the last ".rich" portion unselected (see the screenshot).

The logic which handles the extension is correct in the "txt" case and is incorrect in the "rich" case.

In addition to fixing the bug, we should probably clarify setInitialName() javadoc.