0

I don't understand why my drag and drop working on intelliJ but when I build my project and I run my jar file if I try to drag and drop a file I have this error :

J a v a   M e s s a g e : j a v a . l a n g . r e f l e c t . I n v o c a t i o n T a r g e t E x c e p t i o n

Java :

@FXML
    private void dragOver(DragEvent event) {

        dragDrop.setStyle("-fx-background-color: #DCDCDC;");
        if (event.getDragboard().hasFiles()) event.acceptTransferModes(TransferMode.ANY);
        dragDrop.setOnDragExited(e -> {
            dragDrop.setStyle("-fx-background-color: #FFFAFA;");
        });

        event.consume();
    }
    @FXML
    private void dragDropped(DragEvent event) throws ParserConfigurationException, SAXException, IOException, NoSuchAlgorithmException {

        dragDrop.setStyle("-fx-background-color:  #FFFAFA;");

        myFile = new gmlControle("name","path","size"); // String)
justin1298
  • 147
  • 2
  • 8

1 Answers1

0

Maybe you need tu build your jar with dependencies. Try to look here: JavaFX jar with dependencies bundled.