Example usage for java.awt.dnd DragSource DragSource

List of usage examples for java.awt.dnd DragSource DragSource

Introduction

In this page you can find the example usage for java.awt.dnd DragSource DragSource.

Prototype

public DragSource() throws HeadlessException 

Source Link

Document

Creates a new DragSource .

Usage

From source file:org.jas.dnd.FileDragSource.java

public static void addDragSource(Component c, FileSelection modelSelection) {
    DragSource dragSource = new DragSource();
    FileDragSource dgl = new FileDragSource(dragSource, modelSelection);
    // Do not change ACTION_COPY or else only pain and misery will follow you until the end of time. JAVA DnDrops sux.
    // Big Time/*w  ww.j  a va2  s.  c o m*/
    dragSource.createDefaultDragGestureRecognizer(c, DnDConstants.ACTION_COPY, dgl);
}

From source file:org.kuali.test.ui.components.repositorytree.RepositoryTree.java

/**
 *
 * @param mainframe/*from   w w  w.  jav  a 2  s  . co  m*/
 */
public RepositoryTree(TestCreator mainframe) {
    super(mainframe);
    popupMenu = new RepositoryPopupMenu(mainframe);
    init();
    new RepositoryDropTargetAdapter(this);
    new DragSource().createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY, this);
}