A
A
Asc17712018-03-18 12:48:56
Java
Asc1771, 2018-03-18 12:48:56

How to change the contents of a scene loaded from an fxml file immediately after the program starts?

To clarify the question: in the scene, an object of class Text displays: "Potato". And I need to replace it with what is written in some text file.
I tried to do this through the controller's constructor, binding the object I needed to a variable using @FXML, but when I tried to access this object in the constructor, it turned out that the link was empty - null. This is the only thing I could think of.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Alexandrov, 2018-03-18
@Asc1771

First, read how javafx works, then you will find out that the constructor cannot be used, but this interface must be used instead .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question