Я реализовал пример перетаскивания из учебника JavaFX.
И мне удалось добавить эффект, когда я перетаскиваю вкладку на целевую TabPane:
tabPane.setOnDragEntered(new EventHandler<DragEvent>() {
@Override
public void handle(DragEvent event) {
/* the drag-and-drop gesture entered the target */
/* show to the user that it is an actual gesture target */
if (event.getGestureSource() != tabPane
&& event.getDragboard().hasString()) {
tabPane.setCursor(Cursor.MOVE);
tabPane.setEffect(new Glow());
}
event.consume();
}
});
tabPane.setOnDragExited(new EventHandler<DragEvent>() {
@Override
public void handle(DragEvent event) {
/* mouse moved away, remove the graphical cues */
tabPane.setCursor(Cursor.DEFAULT);
tabPane.setEffect(null);
event.consume();
}
});
Но я хотел бы сделать границы целевой TabPane зелеными вместо добавления эффекта свечения. Это возможно?