-
Bug
-
Resolution: Duplicate
-
P3
-
8
-
MacOS 10.8.2
JDK 8 b65
Attached code does:
scene.addEventHandler(DragEvent.DRAG_ENTERED, new EventHandler<DragEvent>() {
@Override
public void handle(DragEvent dragEvent) {
Dragboard db = dragEvent.getDragboard();
final List<File> files = db.getFiles();
if (!files.isEmpty()) {
try {
final File file = files.get(0);
System.out.println("File: " + file.getAbsolutePath());
System.out.println("File exists: " + file.exists());
} catch (RuntimeException e) {}
} else {
System.out.println("Empty list of files !");
}
dragEvent.consume();
}
});
I start the program from a terminal, then I select in Finder a file and hover my FX scene to enter the event handler.
When running it with Java 7 U10 (or Java 7 U12) I enter the if case, Dragboard.getFiles().get(0) returns the file name I used for hovering.
When running it with Java 8 b65 I go to the else branch "Empty list of files !".
Did I miss something ?
I didn't give it a try on Windows nor Linux.
scene.addEventHandler(DragEvent.DRAG_ENTERED, new EventHandler<DragEvent>() {
@Override
public void handle(DragEvent dragEvent) {
Dragboard db = dragEvent.getDragboard();
final List<File> files = db.getFiles();
if (!files.isEmpty()) {
try {
final File file = files.get(0);
System.out.println("File: " + file.getAbsolutePath());
System.out.println("File exists: " + file.exists());
} catch (RuntimeException e) {}
} else {
System.out.println("Empty list of files !");
}
dragEvent.consume();
}
});
I start the program from a terminal, then I select in Finder a file and hover my FX scene to enter the event handler.
When running it with Java 7 U10 (or Java 7 U12) I enter the if case, Dragboard.getFiles().get(0) returns the file name I used for hovering.
When running it with Java 8 b65 I go to the else branch "Empty list of files !".
Did I miss something ?
I didn't give it a try on Windows nor Linux.
- blocks
-
JDK-8118594 Mac: The Dragboard (DragEvent.getDragboard()) contains invalid files when the dragged file path contains spaces or special characters.
- Resolved
- duplicates
-
JDK-8119796 Mac: DnD is almost totally broken on mac.
- Closed
- relates to
-
JDK-8117742 Mac: DnD doesn't work with String on FX8
- Closed