Example usage for java.awt.dnd DropTarget DropTarget

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

Introduction

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

Prototype

public DropTarget(Component c, int ops, DropTargetListener dtl, boolean act, FlavorMap fm)
        throws HeadlessException 

Source Link

Document

Creates a new DropTarget given the Component to associate itself with, an int representing the default acceptable action(s) to support, a DropTargetListener to handle event processing, a boolean indicating if the DropTarget is currently accepting drops, and a FlavorMap to use (or null for the default FlavorMap ).

Usage

From source file:PanelDropTarget.java

public PanelDropTarget(JPanel pane) {
    this.pane = pane;

    // Create the DropTarget and register
    // it with the JPanel.
    dropTarget = new DropTarget(pane, DnDConstants.ACTION_COPY_OR_MOVE, this, true, null);
}

From source file:EditorDropTarget.java

public EditorDropTarget(JEditorPane pane) {
    this.pane = pane;

    // Create the DropTarget and register
    // it with the JEditorPane.
    dropTarget = new DropTarget(pane, DnDConstants.ACTION_COPY_OR_MOVE, this, true, null);
}

From source file:EditorDropTarget2.java

public EditorDropTarget2(JEditorPane pane) {
    this.pane = pane;

    // Create the DropTarget and register
    // it with the JEditorPane.
    dropTarget = new DropTarget(pane, DnDConstants.ACTION_COPY_OR_MOVE, this, true, null);
}

From source file:EditorDropTarget3.java

public EditorDropTarget3(JEditorPane pane) {
    this.pane = pane;

    // Listen for changes in the enabled property
    pane.addPropertyChangeListener(this);

    // Save the JEditorPane's background color
    backgroundColor = pane.getBackground();

    // Create the DropTarget and register
    // it with the JEditorPane.
    dropTarget = new DropTarget(pane, DnDConstants.ACTION_COPY_OR_MOVE, this, pane.isEnabled(), null);
}

From source file:EditorDropTarget4.java

public EditorDropTarget4(JEditorPane pane) {
    this.pane = pane;

    // Listen for changes in the enabled property
    pane.addPropertyChangeListener(this);

    // Save the JEditorPane's background color
    backgroundColor = pane.getBackground();

    // Create the DropTarget and register
    // it with the JEditorPane.
    dropTarget = new DropTarget(pane, DnDConstants.ACTION_COPY_OR_MOVE, this, pane.isEnabled(), null);
}

From source file:FileTreeDropTarget.java

public FileTreeDropTarget(FileTree tree) {
    this.tree = tree;

    // Listen for changes in the enabled property
    tree.addPropertyChangeListener(this);

    // Create the DropTarget and register 
    // it with the FileTree.
    dropTarget = new DropTarget(tree, DnDConstants.ACTION_COPY_OR_MOVE, this, tree.isEnabled(), null);
}

From source file:DragDropTreeExample.java

public FileTreeDropTarget(FileTree tree) {
    this.tree = tree;

    // Listen for changes in the enabled property
    tree.addPropertyChangeListener(this);

    // Create the DropTarget and register
    // it with the FileTree.
    dropTarget = new DropTarget(tree, DnDConstants.ACTION_COPY_OR_MOVE, this, tree.isEnabled(), null);
}

From source file:org.kuali.test.ui.dnd.RepositoryDropTargetAdapter.java

/**
 *
 * @param repositoryTree/*from  www.ja v a2 s.  c  om*/
 * @param ops
 */
public RepositoryDropTargetAdapter(RepositoryTree repositoryTree, int ops) {
    this.repositoryTree = repositoryTree;
    dropTarget = new DropTarget(repositoryTree, ops, this, true, null);
}