Package java.awt.dnd

Examples of java.awt.dnd.DropTargetAdapter


     *
     * @param comp a JComponent that will be enabled for Drag'n'Drop and the
     * current DataFlavor's
     */
    public void addDropTarget(final JComponent comp) {
        addDropTarget(comp, new DropTargetAdapter() {

            @Override
            public void dragExit(DropTargetEvent dte) {
                super.dragExit(dte);
                dte.getDropTargetContext().getComponent().setCursor(Cursor.getDefaultCursor());
View Full Code Here


            public void windowClosing(WindowEvent e) {
                getApplication().getActionManager().getAction(ExitAction.class).exit();
            }
        });

        new DropTarget(frame, new DropTargetAdapter() {

            public void drop(DropTargetDropEvent dtde) {
                dtde.acceptDrop(dtde.getDropAction());
                Transferable transferable = dtde.getTransferable();
                dtde.dropComplete(processDropAction(transferable));
View Full Code Here

        });

        this.scrollPane = new JScrollPane(this.panel);

        // Set up drag and drop
        DropTargetListener dropTargetListener = new DropTargetAdapter() {
            public void drop(DropTargetDropEvent event) {
                GraphCanvas.this.drop(event);
            }
        };
        new DropTarget(this.panel, DnDConstants.ACTION_COPY_OR_MOVE, dropTargetListener);
View Full Code Here

                ((ExitAction) getApplication().getAction(ExitAction.getActionName()))
                        .exit();
            }
        });

        new DropTarget(frame, new DropTargetAdapter() {

            public void drop(DropTargetDropEvent dtde) {
                dtde.acceptDrop(dtde.getDropAction());
                Transferable transferable = dtde.getTransferable();
                dtde.dropComplete(processDropAction(transferable));
View Full Code Here

        statusPanel.add(dateLabel);
        statusPanel.setMargin(4);
       
        setUI(view);
       
        DropTarget dt = new DropTarget(view, new DropTargetAdapter() {

            @Override
            public void drop(DropTargetDropEvent dtde) {
                dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
                table.getTransferHandler().importData(table, dtde.getTransferable());
View Full Code Here

            public void windowClosing(WindowEvent e) {
                getApplication().getActionManager().getAction(ExitAction.class).exit();
            }
        });

        new DropTarget(frame, new DropTargetAdapter() {

            public void drop(DropTargetDropEvent dtde) {
                dtde.acceptDrop(dtde.getDropAction());
                Transferable transferable = dtde.getTransferable();
                dtde.dropComplete(processDropAction(transferable));
View Full Code Here

                                            DnDConstants.ACTION_COPY_OR_MOVE,
                                            dgl);

      final DataFlavor flavor = moduleFlavor;

      dt = new DropTarget(this, new DropTargetAdapter() {
       
        public void drop(DropTargetDropEvent dtde) {
          try {
            if (dtde.getCurrentDataFlavorsAsList().contains(flavor)) {
              dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
View Full Code Here

      Color c = getBackground();
      setEditable(false);
      setBackground(c);
      final LibraryTextField fld = this;

      dt = new DropTarget(fld, new DropTargetAdapter() {
        public void drop(DropTargetDropEvent dtde) {
          try {
            if (dtde.getCurrentDataFlavorsAsList().contains(libraryFlavor)) {
              dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
              Transferable trf = dtde.getTransferable();
View Full Code Here

TOP

Related Classes of java.awt.dnd.DropTargetAdapter

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.