List of usage examples for java.awt FileDialog setLocationRelativeTo
public void setLocationRelativeTo(Component c)
From source file:utybo.branchingstorytree.swing.editor.StoryEditor.java
public boolean saveAs() { FileDialog fd = new FileDialog(OpenBSTGUI.getInstance(), Lang.get("editor.saveloc"), FileDialog.SAVE); fd.setLocationRelativeTo(OpenBSTGUI.getInstance()); fd.setVisible(true);//w w w .ja va2s .c om if (fd.getFile() != null) { final File file = new File(fd.getFile().endsWith(".bst") ? fd.getDirectory() + fd.getFile() : fd.getDirectory() + fd.getFile() + ".bst"); try { doSave(file); lastFileLocation = file; return true; } catch (IOException | BSTException e1) { OpenBST.LOG.error("Failed saving a file", e1); Messagers.showException(OpenBSTGUI.getInstance(), Lang.get("editor.savefail"), e1); } } return false; }