Package java.awt.dnd

Examples of java.awt.dnd.DragSource


        right.setBackground(Color.white);
        right.setPreferredSize(new Dimension(100, 100));

        new MyDropTargetListener(right);

        DragSource ds = new DragSource();
        ds.createDefaultDragGestureRecognizer(left,
            DnDConstants.ACTION_COPY, this);

        panel.add(openb);
        panel.add(left);
        panel.add(right);
View Full Code Here


        DragGestureListener dragGestureListener = new DragGestureListener() {
            public void dragGestureRecognized(DragGestureEvent event) {
                ComponentSelector.this.dragGestureRecognized(event);
            }
        };
        DragSource dragSource = DragSource.getDefaultDragSource();
        dragSource.createDefaultDragGestureRecognizer(this.tree, DnDConstants.ACTION_COPY_OR_MOVE, dragGestureListener);

        this.dragSourceListener = new DragSourceAdapter() {
            // Overwrite some methods when needed.
        };
View Full Code Here

            }
        }
        catch(SecurityException e) { }
        // Avoid having more than one gesture recognizer active
        disableSwingDragSupport(dragSource);
        DragSource src = DragSource.getDefaultDragSource();
        src.createDefaultDragGestureRecognizer(dragSource, supportedActions, this);
    }
View Full Code Here

            else {
                ghost.returnToOrigin();
            }
            ghost = null;
        }
        DragSource src = e.getDragSourceContext().getDragSource();
        src.removeDragSourceMotionListener(this);
        moved = false;
    }
View Full Code Here

     *
     */
   
    public MusicList( int dndType ) {

        dragSource = new DragSource();
        dragSource.createDefaultDragGestureRecognizer( this, dndType, this );

    }
View Full Code Here

     *
     */
   
    public void init() {
       
        dragSource = new DragSource();
        dragSource.createDefaultDragGestureRecognizer( this, DnDConstants.ACTION_COPY, this );

        setShowsRootHandles( true );

        refresh();
View Full Code Here

        } catch (TooManyListenersException ex) {
            ex.printStackTrace();
        }
        this.setDropTarget(drop);

        DragSource dragSource = DragSource.getDefaultDragSource();
        // creating the recognizer is all that's necessary - it
        // does not need to be manipulated after creation
        dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY, this); // drag gesture listener       
    }
View Full Code Here

    /**
     * Default Constuctor
     */
    public DragTree() {
       
        DragSource dragSource = DragSource.getDefaultDragSource();

        // Use the default gesture recognizer
        dragSource.createDefaultDragGestureRecognizer(
           this,
           DnDConstants.ACTION_COPY_OR_MOVE,
           this);
       
        // Setup to be a drop target
View Full Code Here

    SourceFileListFrame() {
        super("Source File List Frame");
        extractFilesFromTheWorkingDirectory();
        initList();
        initGUI();
        new DragSource().createDefaultDragGestureRecognizer(list,
                DnDConstants.ACTION_COPY,this);
    }
View Full Code Here

        JMenuItem item;

        // drag and drop support
        mMainPanel = new JPanel ();
        mDropTarget = new DropTarget (mMainPanel, this);
        mDragSource = new DragSource ();

        // menu and toolbar
        menubar = new JMenuBar();
        toolbar = new JToolBar ();
        toolbar.setAlignmentY (0.222222F);
View Full Code Here

TOP

Related Classes of java.awt.dnd.DragSource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.