Answers for "java listener"

3

java listener

public void mouseDragged(MouseEvent e) {
	mouseX = e.getX();
	mouseY = e.getY();
	if (SwingUtilities.isLeftMouseButton(e)) {
		mouseB = 1;
	}
	if (SwingUtilities.isRightMouseButton(e)) {
		mouseB = 3;
	}

	MouseDraggedEvent event = new MouseDraggedEvent(e.getX(), e.getY(), mouseB);
	try {
		eventListener.onEvent(event);
	} catch (Exception ex) {}
}
Posted by: Guest on June-02-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language