ok. i answered too fast
the problem is about method Class.forName(...), bacause the return type is Class<?> and what you need is typed class (Class<T>).
the solution is to use:
getToolkit().createDragGestureRecognizer(MouseDragGestureRecognizer.class, source, this, dragAction, listener);
I found the orginal code on internet with this code. My suggestion is to check which
Java version the code refers to, this code was created around 1999 - so it is very old!
Try to find some examples of Java 7.