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

@@ -395,9 +395,7 @@ public class DumpTree extends JTree {
JFileChooser fc = new JFileChooser();
String selDir = Configuration.lastOpenDir.get();
fc.setCurrentDirectory(new File(selDir));
JFrame f = new JFrame();
View.setWindowIcon(f);
if (fc.showSaveDialog(f) == JFileChooser.APPROVE_OPTION) {
if (fc.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) {
File sf = Helper.fixDialogFile(fc.getSelectedFile());
try (OutputStream fos = new BufferedOutputStream(new FileOutputStream(sf))) {
byte[] data = DumpInfoSwfNode.getSwfNode(dumpInfo).getSwf().originalUncompressedData;