Here's my implementation using Robot. It was easier than I expected,
and works great. To use it, just create an InfiniteDragListener, then
listen to it as your source of mouse press, drag, and release events. It
prevents the cursor from moving more than a few pixels from the click
location, while generating events as if the cursor were moving freely over
an unbounded screen. This uses Buoy (http://buoy.sourceforge.net), but it
would be easy to create a Swing version.
Peter
import buoy.event.*;
import buoy.widget.*;
import javax.swing.*;
import java.awt.*;
public class InfiniteDragListener extends EventSource
{
private Widget source;
private Robot robot;
private Point startPoint, startScreenPoint, lastPoint;
private int dx, dy;
private boolean expectingReset;
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden