-
Bug
-
Resolution: Not an Issue
-
P4
-
7u40, 8
-
Linux (tried Ubuntu 12.04)
Touch file /tmp/existing.fxml on your system.
Then run the code below and in the File Chooser dialog enter 'existing' without the file extension.
Press Save button: on Mac and Win you get an overwrite confirmation dialog, then if you confirm the file returned is /tmp/existing.fxml.
On Linux you get no overwrite confirmation dialog and the file returned is /tmp/existing, the extension part is missing.
package javaapplication1;
import java.io.File;
import javafx.application.Application;
import static javafx.application.Application.launch;
import javafx.stage.FileChooser;
import javafx.stage.FileChooserBuilder;
import javafx.stage.FileChooser.ExtensionFilter;
import javafx.stage.Stage;
public class JavaApplication1 extends Application {
@Override
public void start(Stage primaryStage) {
FileChooser fileChooser = FileChooserBuilder.create().initialDirectory(new File("/tmp")).extensionFilters(new ExtensionFilter("fxml", "*.fxml")).build();
File ignored = fileChooser.showSaveDialog(primaryStage);
System.out.println("File returned by chooser is " + ignored);
}
public static void main(String[] args) {
launch(args);
}
}
Then run the code below and in the File Chooser dialog enter 'existing' without the file extension.
Press Save button: on Mac and Win you get an overwrite confirmation dialog, then if you confirm the file returned is /tmp/existing.fxml.
On Linux you get no overwrite confirmation dialog and the file returned is /tmp/existing, the extension part is missing.
package javaapplication1;
import java.io.File;
import javafx.application.Application;
import static javafx.application.Application.launch;
import javafx.stage.FileChooser;
import javafx.stage.FileChooserBuilder;
import javafx.stage.FileChooser.ExtensionFilter;
import javafx.stage.Stage;
public class JavaApplication1 extends Application {
@Override
public void start(Stage primaryStage) {
FileChooser fileChooser = FileChooserBuilder.create().initialDirectory(new File("/tmp")).extensionFilters(new ExtensionFilter("fxml", "*.fxml")).build();
File ignored = fileChooser.showSaveDialog(primaryStage);
System.out.println("File returned by chooser is " + ignored);
}
public static void main(String[] args) {
launch(args);
}
}
- blocks
-
JDK-8092806 No warning when saving on an existing file w\o file extension(Linux)
-
- Resolved
-
- duplicates
-
JDK-8123011 Gtk: File saving with extension is broken on linux: extension is not added.
-
- Closed
-
- relates to
-
JDK-8125194 Gtk: FileChooser save dialog does not ask for confirmation to overwrite an existing file on Linux
-
- Closed
-
-
JDK-8264992 FileChooser prevents application interaction
-
- Open
-