Browse Source

REPORT-148456 fix:【NewUI】遮罩层阻断鼠标事件

fbp/feature^2
Levy.Xie-解安森 3 days ago
parent
commit
aaf271fc4b
  1. 11
      designer-base/src/main/java/com/fine/component/popup/GlassPopupManager.java

11
designer-base/src/main/java/com/fine/component/popup/GlassPopupManager.java

@ -1,5 +1,6 @@
package com.fine.component.popup; package com.fine.component.popup;
import javax.swing.JComponent;
import javax.swing.JLayeredPane; import javax.swing.JLayeredPane;
import javax.swing.JRootPane; import javax.swing.JRootPane;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
@ -90,6 +91,16 @@ public class GlassPopupManager {
JRootPane rootPane = SwingUtilities.getRootPane(container); JRootPane rootPane = SwingUtilities.getRootPane(container);
instance.contentPane = rootPane.getContentPane(); instance.contentPane = rootPane.getContentPane();
rootPane.setGlassPane(instance.layerPane); rootPane.setGlassPane(instance.layerPane);
interceptMouseEvents(instance.layerPane);
}
private static void interceptMouseEvents(JComponent layerPane) {
// 拦截鼠标事件
layerPane.addMouseListener(new MouseAdapter() {
});
layerPane.addMouseMotionListener(new MouseAdapter() {
});
} }
/** /**

Loading…
Cancel
Save