From 0a6bbd3517217a5ff09258084ff2fd1bfa95acc0 Mon Sep 17 00:00:00 2001 From: shine Date: Tue, 26 Oct 2021 13:53:09 +0800 Subject: [PATCH] =?UTF-8?q?CHART-21418=20fix:=E9=A2=9C=E8=89=B2=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E5=BC=B9=E6=A1=86=20=E5=A6=82=E6=9E=9C=E6=98=AF?= =?UTF-8?q?=E4=BB=8EdisplayComponent=E4=B8=8A=E9=9D=A2=E7=A6=BB=E5=BC=80?= =?UTF-8?q?=E7=9A=84=EF=BC=8C=E9=9A=90=E8=97=8F=E5=BC=B9=E5=87=BA=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/style/AbstractSelectBox.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/style/AbstractSelectBox.java b/designer-base/src/main/java/com/fr/design/style/AbstractSelectBox.java index 1d66094f1..7ebaa9d9d 100644 --- a/designer-base/src/main/java/com/fr/design/style/AbstractSelectBox.java +++ b/designer-base/src/main/java/com/fr/design/style/AbstractSelectBox.java @@ -6,7 +6,11 @@ import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Insets; +import java.awt.Rectangle; import java.awt.RenderingHints; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; @@ -94,6 +98,18 @@ public abstract class AbstractSelectBox extends AbstractPopBox implements Mou hidePopupMenu(); } }); + + displayComponent.addMouseListener(new MouseAdapter() { + @Override + public void mouseExited(MouseEvent e) { + Rectangle rectangle = displayComponent.getBounds(); + if (e.getY() < rectangle.y) { + //如果是从displayComponent上面离开的,隐藏弹出界面。 + hidePopupMenu(); + } + + } + }); } public void setEnabled(boolean enabled) {