AWTEvent setSource - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for AWTEvent setSource method.

This code example shows how to use the following methods:setSource
import javax.swing.*; 
import java.awt.event.MouseEvent;
 
public class bug6690791 { 
    public static void main(String[] args) throws Exception {
        MouseEvent me = new MouseEvent(new JLabel(), MouseEvent.MOUSE_CLICKED,
                System.currentTimeMillis(), MouseEvent.ALT_MASK,
                10, 10, 100, 100, 1, false, MouseEvent.BUTTON1);
        me.setSource(new Object());
        MenuSelectionManager.defaultManager().processMouseEvent(me);
    } 
} 
6
CodeRank
This code example shows how to use the following methods:setSource
//	{ 
//	} 
	 
	private void redispatch( AWTEvent e )
	{ 
		e.setSource( target );
		target.dispatchEvent( e );
	} 
 
	private void redispatchMouse( MouseEvent e )
	{ 
		redispatch( SwingUtilities.convertMouseEvent( e.getComponent(), e, target ));
	} 
 
	public void mouseClicked( MouseEvent e )
	{ 
		redispatchMouse( e );
	} 
 
	public void mouseEntered( MouseEvent e )
3
CodeRank
setSource Method Overview
Retargets an event to a new source.
See Code Examples for other Java 8 AWTEvent Methods: