r/learnjava • • Oct 20 '23

JavaFX Tableview

Still learning Java and making some JavaFX apps. I have a question about Updating a Tableview from a different stage or if it's possible.

The idea I have is I have one stage that contains a table view with game data(e.g. game name, console etc.)and a button that when clicked opens another stage with text fields that I can enter game data into, click a button and the data is added to the table.

So I'd have 2 fxml layouts and 2 controllers.

I can't find any example on how to do this but maybe I'm going about it the wrong was so any advice or resources are appreciated.

2 Upvotes

4 comments sorted by

View all comments

Show parent comment

1

u/Strawboy97 Oct 20 '23

So my issue is more with updating and deleting data across two controllers.

https://github.com/Colin-Masterson/GameBacklogJavafx

My code is above I can delete a game if there is data there. But if I add a game then try to delete the table doesn't update even though it deletes from the database.

0

u/[deleted] Oct 21 '23

[deleted] — view deleted comment

1

u/Strawboy97 Oct 21 '23

Thank you I'll give this a go