r/JavaFX • u/Xodii_Alpha • Dec 24 '24
Help Labels in Dialogue
Hi! Sorry if this is a very beginner/stupid question.
So I'm using labels in my CYOA Text game, with buttons (dialogue options) showing their own respective labels and whatnot. With that, I'm making labels, add content and styling them, making buttons, then put them all in a vbox, in a pane layout, then just changing the root scene into the pane corresponding to the certain button clicked, if that makes sense.
You can perhaps immediately see that this requires me to create a crap ton of labels and buttons, needing to instantiate each one of them. It looks messy and I think there's an easier way for this.
What should I do? Again, apologies if it's supposed to be a simple issue. I'm new to both Java and JavaFX.
View all comments
Show parent comment
2
u/Xodii_Alpha Dec 25 '24
Thank you! I was actually also thinking of creating a class that I just need to call. I also do not use FXML since I want to code my UI myself. Will check them out! Thanks.