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); + } + }); } /**