|
|
@ -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() { |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|