changeset 844:6944bd0bec20

Fix AboutDialog to center on the Thermostat main window review-thread: http://icedtea.classpath.org/pipermail/thermostat/2012-December/004503.html reviewed-by: rkennke
author Mario Torre <neugens.limasoftware@gmail.com>
date Tue, 11 Dec 2012 21:38:31 +0100
parents eee59ae0941e
children fae254369e34 d71dd876fd29
files client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/AboutDialog.java
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/AboutDialog.java	Tue Dec 11 21:38:31 2012 +0100
+++ b/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/AboutDialog.java	Tue Dec 11 21:38:31 2012 +0100
@@ -60,6 +60,7 @@
 
 import com.redhat.thermostat.client.locale.LocaleResources;
 import com.redhat.thermostat.client.swing.IconResource;
+import com.redhat.thermostat.client.swing.ThermostatSwingUtils;
 import com.redhat.thermostat.client.swing.UIResources;
 import com.redhat.thermostat.common.ApplicationInfo;
 import com.redhat.thermostat.common.locale.Translate;
@@ -86,6 +87,9 @@
      * @param applicationInfo 
      */
     public AboutDialog(ApplicationInfo appInfo) {
+        
+        super(ThermostatSwingUtils.getMainFrame(), true);
+        
         setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
         setResizable(false);
         
@@ -100,6 +104,14 @@
         
         initComponents();
     }
+
+    @Override
+    public void setVisible(boolean b) {
+        if (b) {
+            setLocationRelativeTo(ThermostatSwingUtils.getMainFrame());
+        }
+        super.setVisible(b);
+    }
     
     private void initComponents() {
         setBounds(100, 100, 450, 338);