FileDocCategorySizeDatePackage
GestureTest.javaAPI DocExample1179Thu Oct 24 20:14:28 BST 2002None

GestureTest

public class GestureTest extends JFrame implements DragGestureListener

Fields Summary
DragSource
ds
JList
jl
String[]
items
Constructors Summary
public GestureTest()


    
    super("Gesture Test");
    setSize(200,150);
    addWindowListener(new WindowAdapter() {
      public void windowClosing(WindowEvent we) {
        System.exit(0);
      }
    });
    jl = new JList(items);
    jl.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    getContentPane().add(new JScrollPane(jl), BorderLayout.CENTER);

    ds = new DragSource();
    DragGestureRecognizer dgr = ds.createDefaultDragGestureRecognizer(
			  jl, DnDConstants.ACTION_COPY, this);
    setVisible(true);
  
Methods Summary
public voiddragGestureRecognized(java.awt.dnd.DragGestureEvent dge)

    System.out.println("Drag Gesture Recognized!");
  
public static voidmain(java.lang.String[] args)

    new GestureTest();