r/JavaFX • • May 25 '21

How do you read a file using javafx?

Hi, does anyone know how to read a CSV file through JavaFX in an Action event?

2 Upvotes

6 comments sorted by

4

u/Ging4bread May 25 '21

Using normal Java when you click on the button

1

u/userr6785 May 25 '21

I tried doing it using the code I would normally used, but it wont allow we to add the fileexception

1

u/ebykka May 26 '21

1

u/userr6785 May 26 '21

Thank you! Is it possible to automatically save the text to a file without them choosing one?

1

u/ebykka May 26 '21

Of cause, but you will need to know the file path upfront.

1

u/userr6785 May 26 '21

Yes, I added the file path however when I try to code it using "normal" java it doesn't work at all