Skip to content
Snippets Groups Projects
Verified Commit dca3fbec authored by tristan.muller's avatar tristan.muller Committed by philippe.verley_ird.fr
Browse files

Fix the JProgressFrame centering

parent 9be14232
No related branches found
No related tags found
No related merge requests found
...@@ -41,6 +41,13 @@ public class JProgressFrame extends FrameView { ...@@ -41,6 +41,13 @@ public class JProgressFrame extends FrameView {
public JProgressFrame() throws Exception { public JProgressFrame() throws Exception {
super(); super();
setLocationRelativeTo(getParent());
setResizable(false);
setVisible(true);
if (onInitCallback != null) {
onInitCallback.run();
}
} }
public void setOnInitCallback(final Runnable onInitCallback) { public void setOnInitCallback(final Runnable onInitCallback) {
...@@ -60,14 +67,11 @@ public class JProgressFrame extends FrameView { ...@@ -60,14 +67,11 @@ public class JProgressFrame extends FrameView {
@Override @Override
protected void initContainer() throws Exception { protected void initContainer() throws Exception {
setLocationRelativeTo(getParent());
setIconImage(loadIcon("/icons/progression.png").getImage()); setIconImage(loadIcon("/icons/progression.png").getImage());
setVisible(true); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setResizable(false); setTitle("Progression");
getContentPane().setLayout(new javax.swing.BoxLayout(getContentPane(),
if (onInitCallback != null) { javax.swing.BoxLayout.PAGE_AXIS));
onInitCallback.run();
}
} }
@Override @Override
...@@ -77,11 +81,6 @@ public class JProgressFrame extends FrameView { ...@@ -77,11 +81,6 @@ public class JProgressFrame extends FrameView {
jPanelStatus = new javax.swing.JPanel(); jPanelStatus = new javax.swing.JPanel();
jLabelStatus = new javax.swing.JLabel(); jLabelStatus = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("Progression");
getContentPane().setLayout(new javax.swing.BoxLayout(getContentPane(),
javax.swing.BoxLayout.PAGE_AXIS));
jProgressBar.setPreferredSize(new java.awt.Dimension(500, 19)); jProgressBar.setPreferredSize(new java.awt.Dimension(500, 19));
jPanelProgress.add(jProgressBar); jPanelProgress.add(jProgressBar);
...@@ -94,6 +93,5 @@ public class JProgressFrame extends FrameView { ...@@ -94,6 +93,5 @@ public class JProgressFrame extends FrameView {
pack(); pack();
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment