Answer the question
In order to leave comments, you need to log in
Spinner in JavaFX, how to assign SpinnerValueFactory.IntegerSpinnerValueFactory?
Tell me which way to dig.
There is a scene in which the spinner itself is located (screen.fxml)
<Spinner fx:id="SpinnerRequests" layoutX="127.0" layoutY="78.0" />
There is a controller in which I have to work with this spinner.import javafx.fxml.FXML;
import javafx.scene.control.Spinner;
public class Controller {
@FXML public Spinner SpinnerRequests;
}
IntegerSpinnerValueFactory
does not work. IntegerSpinnerValueFactory(int min, int max, int initialValue)
Answer the question
In order to leave comments, you need to log in
When creating an instance of the controller, FXMLLoader itself creates the necessary objects and writes them to variables. You cannot overwrite them, because. the new object will not be associated with the interface.
The compiler cursed @Override because your controller did not implement the Initializable interface, you need to add this text after the controller class name: implements Initializable . An annotation should also be left.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question