ShowSaveDialog appears behind core FXML

I used showSaveDialog in the controller class for FXML. When a hyperlink is clicked, showSaveDialog should open a dialog box to save the file. The Save File dialog box opens, but it appears behind the fxml file from which it is called. I have to minimize the main fxml file and then save the file using the showavedialog window. Please, help

    JFileChooser fc = new JFileChooser();
    fc.setSelectedFile(new File(fileName));
    fc.setDialogTitle("Choose a path to Save file");
    int returnVal = fc.showSaveDialog(this);
+3
source share

All Articles