|
|
|
@ -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<T> 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) { |
|
|
|
|