diff --git a/src/main/java/org/jabref/gui/JabRefFrame.java b/src/main/java/org/jabref/gui/JabRefFrame.java index ba86aa068b8..834f7beb325 100644 --- a/src/main/java/org/jabref/gui/JabRefFrame.java +++ b/src/main/java/org/jabref/gui/JabRefFrame.java @@ -232,8 +232,8 @@ private void initDragAndDrop() { this.getScene().setOnDragEntered(event -> { // It is necessary to setOnDragOver for newly opened tabs // drag'n'drop on tabs covered dnd on tabbedPane, so dnd on tabs should contain all dnds on tabbedPane - tabbedPane.lookupAll(".tab").forEach(t -> { - t.setOnDragOver(tabDragEvent -> { + tabbedPane.lookupAll(".tab").forEach(tab -> { + tab.setOnDragOver(tabDragEvent -> { if (DragAndDropHelper.hasBibFiles(tabDragEvent.getDragboard())) { tabDragEvent.acceptTransferModes(TransferMode.ANY); if (!tabbedPane.getTabs().contains(dndIndicator)) { @@ -249,8 +249,8 @@ private void initDragAndDrop() { tabDragEvent.consume(); } }); - t.setOnDragExited(event1 -> tabbedPane.getTabs().remove(dndIndicator)); - t.setOnDragDropped(tabDragEvent -> { + tab.setOnDragExited(event1 -> tabbedPane.getTabs().remove(dndIndicator)); + tab.setOnDragDropped(tabDragEvent -> { if (DragAndDropHelper.hasBibFiles(tabDragEvent.getDragboard())) { tabbedPane.getTabs().remove(dndIndicator); List bibFiles = DragAndDropHelper.getBibFiles(tabDragEvent.getDragboard()); @@ -260,7 +260,7 @@ private void initDragAndDrop() { tabDragEvent.consume(); } else { for (Tab libraryTab : tabbedPane.getTabs()) { - if (libraryTab.getId().equals(t.getId()) && + if (libraryTab.getId().equals(tab.getId()) && !tabbedPane.getSelectionModel().getSelectedItem().equals(libraryTab)) { ((LibraryTab) libraryTab).dropEntry(stateManager.getLocalDragboard().getBibEntries()); }