r/JavaFX • • Jan 16 '25

Help Grouping @JXML into an entity

Is it possible to combine several

```

\@FXML private TextField myField

```

into a separate class, which then would be used in a `\@FxmlView`?

1 Upvotes

14 comments sorted by

View all comments

Show parent comment

1

u/Draaksward_89 Jan 16 '25

Thanks. This is what I needed.

1

u/SpittingBull Jan 16 '25

NP - again: be aware that initialize() in theDashboardDialog controller is invoked before the parent controller. Or generally speaking: within the initialize() method of a child controller you can not reliably access controls of the parent or other child controllers.

If that is an issue you need some form of a synchronization like a separate initialization method in the child controller that is explicitly invoked from within the parent controllers initialize() method.

1

u/Draaksward_89 Jan 17 '25

I understand. Still digesting the whole question of JavaFX, so brain feel numb.