From 393f2c7c9f5b8d742fd7fea1541bda9ad922b179 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 23 Oct 2020 09:16:40 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-39952=20=E3=80=90=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E9=AA=8C=E6=94=B6=E3=80=91=E3=80=90JDK11=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E3=80=91150%=E6=97=B6=20=E6=8F=92=E4=BB=B6=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=98=BE=E7=A4=BA=E8=BF=87=E5=A4=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/extra/ShopDialog.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/extra/ShopDialog.java b/designer-base/src/main/java/com/fr/design/extra/ShopDialog.java index 69ad0f08d1..e0170cef88 100644 --- a/designer-base/src/main/java/com/fr/design/extra/ShopDialog.java +++ b/designer-base/src/main/java/com/fr/design/extra/ShopDialog.java @@ -2,6 +2,7 @@ package com.fr.design.extra; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.UIDialog; +import com.fr.design.jdk.JdkVersion; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.stable.StableUtils; @@ -12,7 +13,6 @@ import java.awt.*; * Created by vito on 16/4/18. */ public class ShopDialog extends UIDialog { - private static final Dimension DEFAULT_SHOP = new Dimension(900, 700); public ShopDialog(Frame frame, BasicPane pane) { super(frame); @@ -22,11 +22,21 @@ public class ShopDialog extends UIDialog { JPanel panel = (JPanel) getContentPane(); panel.setLayout(new BorderLayout()); add(pane, BorderLayout.CENTER); - setSize(DEFAULT_SHOP); + setSize(createDefaultDimension()); GUICoreUtils.centerWindow(this); setResizable(false); } + private Dimension createDefaultDimension() { + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + // jdk11 分辨率较低 缩放较大时 屏幕高度小于或接近设定的高度 需要调整下 + if (JdkVersion.GE_9.support() && screenSize.height - 700 < 50) { + return new Dimension(900, screenSize.height - 100); + } else { + return new Dimension(900, 700); + } + } + @Override public void checkValid() throws Exception { // do nothing