si mi ricordo una cosa del genere in swing in effetti.

così potrebbe essere un'idea:
codice:
public static void exportJson(String file, String json) throws IOException {
    String ext = FilenameUtils.getExtension(file);
    if (ext.isEmpty()) {
        file += ".json";
    }
    FileUtils.writeStringToFile(new File(file), json, StandardCharsets.UTF_8);
}

banalmente, controllo se l'estensione non è vuota, e in caso la aggiungo.