私はJavaFxで新しく、Filechooserで既に選択されているファイルを自分のプロジェクトフォルダにコピーする方法を知りました。選択したファイルをプロジェクトディレクトリにコピー
public void ButtonAction(ActionEvent event) {
FileChooser fc = new FileChooser();
fc.setTitle("attach a file");
File selectedFile = fc.showOpenDialog(null);
if (selectedFile != null) {
file1.setText("selectionned file : " + selectedFile.getAbsolutePath());
//the code to copy the selected file goes here//
} else{
file1.setText("no file attached");
}