Skip to content

Commit

Permalink
Added showDialog method for JFileChooser compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver-Loeffler committed Jul 6, 2019
1 parent 6bf7ef8 commit c8d451b
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import java.io.File;
import java.util.function.Consumer;

import javax.swing.JFrame;
import javax.swing.SwingUtilities;

import javafx.stage.FileChooser;
Expand Down Expand Up @@ -52,11 +51,15 @@ public FileChooser getDialog() {
return dialog;
}

public int showOpenDialog(JFrame frame) {
public int showDialog(Window window) {
return this.adapter.runDialog(window);
}

public int showOpenDialog(Window frame) {
return this.adapter.runDialog(frame);
}

public int showSaveDialog(JFrame frame) {
public int showSaveDialog(Window frame) {
return this.adapter.runDialog((FileChooser dialog, Window window)->dialog.showSaveDialog(null), frame);
}

Expand Down

0 comments on commit c8d451b

Please sign in to comment.