Reputation:
I have a ProgressBar in javafx fxml file. How can I make it indeterminate in controller?
EDIT 1 In javafx scenebuilder you can make a progressbar indeterminate via checkbox. So, I want to do it in controller. By other words, how can I do it via code?
Upvotes: 8
Views: 11739
Reputation: 4803
As you do not provide enough code, like you normally should MCVE, I will assume you need the following controller code:
public class FXMLDocumentController {
@FXML
private ProgressBar bar;
@FXML
private void initialize() {
bar.setProgress(ProgressBar.INDETERMINATE_PROGRESS);
}
}
This simply sets the Progress to -1.
Upvotes: 25