Center progress bar on drawing.

This commit is contained in:
Holt59 2018-02-27 23:27:18 +01:00
parent 823ed07770
commit 094840f152
2 changed files with 3 additions and 4 deletions

View File

@ -68,9 +68,6 @@ public class GraphReaderProgressBar extends JDialog implements GraphReaderObserv
setContentPane(pane); setContentPane(pane);
// setModal(true);
setLocationRelativeTo(owner);
pack(); pack();
} }

View File

@ -518,7 +518,9 @@ public class MainWindow extends JFrame {
else { else {
reader = new BinaryGraphReader(stream); reader = new BinaryGraphReader(stream);
} }
reader.addObserver(new GraphReaderProgressBar(MainWindow.this)); GraphReaderProgressBar progressBar = new GraphReaderProgressBar(MainWindow.this);
progressBar.setLocationRelativeTo(mainPanel.getLeftComponent());
reader.addObserver(progressBar);
try { try {
graph = reader.read(); graph = reader.read();
} }