]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/PackageEditor/src/org/tianocore/packaging/UpdateLibraryClass.java
Fix the problem "update action multiple times fail".
[mirror_edk2.git] / Tools / Source / PackageEditor / src / org / tianocore / packaging / UpdateLibraryClass.java
index 8e796d48f142c859b1b3b2eb718645a36cba8b70..4bd6a136300a2d49ac4cb81cc3c1a0e4998ed18c 100644 (file)
@@ -24,6 +24,8 @@ import javax.swing.table.*;
 \r
 import org.tianocore.common.Tools;\r
 \r
+import java.awt.Dimension;\r
+import java.awt.Toolkit;\r
 import java.awt.event.ActionEvent;\r
 import java.awt.event.ActionListener;\r
 import java.io.*;\r
@@ -88,6 +90,23 @@ public class UpdateLibraryClass extends JFrame implements ActionListener {
         this.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\r
         this.setTitle("Update Library Class Declarations");\r
         this.setContentPane(getJContentPane());\r
+        this.centerWindow();\r
+    }\r
+    /**\r
+     Start the window at the center of screen\r
+     \r
+     **/\r
+    protected void centerWindow(int intWidth, int intHeight) {\r
+        Dimension d = Toolkit.getDefaultToolkit().getScreenSize();\r
+        this.setLocation((d.width - intWidth) / 2, (d.height - intHeight) / 2);\r
+    }\r
+\r
+    /**\r
+     Start the window at the center of screen\r
+     \r
+     **/\r
+    protected void centerWindow() {\r
+        centerWindow(this.getSize().width, this.getSize().height);\r
     }\r
 \r
     /**\r