Set parent component for Save/Open file dialogs

This commit is contained in:
Jindra Petřík
2021-03-27 10:16:28 +01:00
parent c7c66c55e5
commit a52a4206ca
9 changed files with 14 additions and 40 deletions

View File

@@ -751,9 +751,7 @@ public class FontPanel extends JPanel {
fc.setFileFilter(ttfFilter);
fc.setAcceptAllFileFilterUsed(false);
JFrame fr = new JFrame();
View.setWindowIcon(fr);
int returnVal = fc.showOpenDialog(fr);
int returnVal = fc.showOpenDialog(Main.getDefaultMessagesComponent());
if (returnVal == JFileChooser.APPROVE_OPTION) {
Configuration.lastOpenDir.set(Helper.fixDialogFile(fc.getSelectedFile()).getParentFile().getAbsolutePath());
File selfile = Helper.fixDialogFile(fc.getSelectedFile());