From 094840f15265aef241f4f5d508124b529242e28b Mon Sep 17 00:00:00 2001 From: Holt59 Date: Tue, 27 Feb 2018 23:27:18 +0100 Subject: [PATCH] Center progress bar on drawing. --- src/main/org/insa/graphics/GraphReaderProgressBar.java | 3 --- src/main/org/insa/graphics/MainWindow.java | 4 +++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/org/insa/graphics/GraphReaderProgressBar.java b/src/main/org/insa/graphics/GraphReaderProgressBar.java index 04ff7f3..9899737 100644 --- a/src/main/org/insa/graphics/GraphReaderProgressBar.java +++ b/src/main/org/insa/graphics/GraphReaderProgressBar.java @@ -68,9 +68,6 @@ public class GraphReaderProgressBar extends JDialog implements GraphReaderObserv setContentPane(pane); - // setModal(true); - setLocationRelativeTo(owner); - pack(); } diff --git a/src/main/org/insa/graphics/MainWindow.java b/src/main/org/insa/graphics/MainWindow.java index d6f53c3..ede35cc 100644 --- a/src/main/org/insa/graphics/MainWindow.java +++ b/src/main/org/insa/graphics/MainWindow.java @@ -518,7 +518,9 @@ public class MainWindow extends JFrame { else { reader = new BinaryGraphReader(stream); } - reader.addObserver(new GraphReaderProgressBar(MainWindow.this)); + GraphReaderProgressBar progressBar = new GraphReaderProgressBar(MainWindow.this); + progressBar.setLocationRelativeTo(mainPanel.getLeftComponent()); + reader.addObserver(progressBar); try { graph = reader.read(); }