Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8124854

Gtk: Linux (Ubuntu 11.04 32 Bit): Accessing the contend of the Dragboard data during a drag and drop operation (setOnDragEntered, setOnDragOver) does not work as expected.

    Details

      Backports

        Description

        Accessing the contend of the Dragboard data during a drag and drop operation (setOnDragEntered, setOnDragOver) does not work as expected.


        EXAMPLE (taken from HelloDragAndDrop.java example):

        target.setOnDragEntered(new EventHandler <DragEvent>() {
                    public void handle(DragEvent event) {

                        if (event.getGestureSource() != target && event.getDragboard().hasString()) {
                        

                            System.out.println(event.getDragboard().getString().toString()); //##############This will throw an NullPointer Exception.
                       
                            target.setFill(Color.GREEN);
                        }
                        
                        event.consume();
                    }
                });




                target.setOnDragOver(new EventHandler <DragEvent>() {
                    public void handle(DragEvent event) {

                        if (event.getGestureSource() != target && event.getDragboard().hasString()) {
                        
                         System.out.println(event.getDragboard().getString().toString()); //##############This will throw an NullPointer Exception.

                            event.acceptTransferModes(TransferMode.COPY_OR_MOVE);
                        }
                        
                        event.consume();
                    }
                });




        If the code is run on Windows, the error does not occur.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  azvegint Alexander Zvegintsev
                  Reporter:
                  duke J. Duke (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported: