Browse Source

feat:修复场景切换窗口不居中的问题

yangyi 1 month ago
parent
commit
5912bd4d77
1 changed files with 3 additions and 0 deletions
  1. 3 0
      client/src/main/java/space/anyi/client/App.java

+ 3 - 0
client/src/main/java/space/anyi/client/App.java

@@ -28,6 +28,7 @@ public class App extends Application {
         Scene scene = new Scene(loader.load());
         addStylesheets(scene);
         primaryStage.setScene(scene);
+        primaryStage.centerOnScreen();
     }
 
     public static void showRegisterScene() throws Exception {
@@ -35,6 +36,7 @@ public class App extends Application {
         Scene scene = new Scene(loader.load());
         addStylesheets(scene);
         primaryStage.setScene(scene);
+        primaryStage.centerOnScreen();
     }
 
     public static void showMainScene() throws Exception {
@@ -42,6 +44,7 @@ public class App extends Application {
         Scene scene = new Scene(loader.load());
         addStylesheets(scene);
         primaryStage.setScene(scene);
+        primaryStage.centerOnScreen();
     }
 
     public static Stage getPrimaryStage() {