From 5cd2c395b1c3a25c056e53391f69c51f0db398fe Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 23 Jul 2021 10:50:05 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-55629=20=E3=80=90=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E8=83=8C=E6=99=AF=E5=88=86=E7=A6=BB=E3=80=91=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=A4=8D=E7=94=A8-=E6=8E=A7=E4=BB=B6/=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=88=9A=E6=8B=96=E5=85=A5=E8=AE=BE=E8=AE=A1=E7=94=BB=E5=B8=83?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E5=B7=A5=E5=85=B7=E6=A0=8F=E6=B2=A1=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E5=AE=8C=E5=85=A8=EF=BC=8C=E5=8F=AA=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=BA=86=E4=B8=80=E6=9D=A1=E7=BA=BF=EF=BC=8C=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E9=BC=A0=E6=A0=87=E7=9A=84=E8=AF=9D=E6=89=8D=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=AD=A3=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/designer/creator/XCreator.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java index fa9267b1a7..185c834f75 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java @@ -33,6 +33,7 @@ import com.fr.stable.StringUtils; import javax.swing.BorderFactory; import javax.swing.JComponent; import javax.swing.JPanel; +import javax.swing.SwingUtilities; import javax.swing.border.Border; import java.awt.BorderLayout; import java.awt.Color; @@ -776,10 +777,16 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo } int extraX = (int) ((bounds.x + bounds.width + SelectedPopupDialog.OFFSET_X) * designer.getScale()); int extraY = (int) (bounds.y * designer.getScale()); - popup.setLocation(designer.getLocationOnScreen().x + designer.getPaintX() + extraX, designer.getLocationOnScreen().y + designer.getPaintY() + extraY); - popup.updatePane(designer); - popup.setVisible(selected && accept && popup.hasVisibleButtons() && popup.isCanVisible()); - popup.setRelativeBounds(bounds); + // 放到事件尾部执行 + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + popup.setLocation(designer.getLocationOnScreen().x + designer.getPaintX() + extraX, designer.getLocationOnScreen().y + designer.getPaintY() + extraY); + popup.updatePane(designer); + popup.setVisible(selected && accept && popup.hasVisibleButtons() && popup.isCanVisible()); + popup.setRelativeBounds(bounds); + } + }); } /**