Here you can find the source of passBehind(MouseEvent e)
Pass the event behind.
Parameter | Description |
---|---|
e | the mouse released event |
static void passBehind(MouseEvent e)
//package com.java2s; import java.awt.Container; import java.awt.Point; import java.awt.event.MouseEvent; import javax.swing.JComponent; import javax.swing.SwingUtilities; public class Main { /**//from w w w . j a va 2 s .com * <p> * Pass the event behind. * </p> * * @param e * the mouse released event */ static void passBehind(MouseEvent e) { JComponent source = (JComponent) e.getSource(); Container parent = source.getParent(); if (parent != null) { Point pos = SwingUtilities.convertPoint(source, e.getPoint(), parent); MouseEvent event = new MouseEvent(parent, e.getID(), e.getWhen(), e.getModifiers(), pos.x, pos.y, e.getClickCount(), e.isPopupTrigger()); parent.dispatchEvent(event); } } }