We are about to switch to a new forum software. Until then we have removed the registration on this forum.
After a lot of research, I came up with a better file select (and you can easily figure out a save dialog from this) dialog -
import static javafx.stage.FileChooser.ExtensionFilter;
import javafx.stage.FileChooser;
protected File selectFilteredInput(String title, ExtensionFilter... filters) {
//my code
FileChooser fileChooser = new FileChooser();
fileChooser.setTitle(title);
fileChooser.getExtensionFilters().addAll(filters);
File selectedFile = fileChooser.showOpenDialog(null);
return selectedFile;
}
Follow what I say here to install the JavaFX library.
Comments
And a clear advantage of this is that it works on Windows as well, unlike
FileDialog
.Problem is - it only works with FX2D renderer.