-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
8
I created a ProgressIndicator with setProgress(-1) and add it to a StackPane. If I do "setVisibility(false)" before showing the stage and do "setVisible(true)" after showing the stage, the ProgressIndicator is showing but not animating.
It works only if I do "setVisible(false)" AFTER showing the stage.
Here my test code:
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.ProgressIndicator;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class TestProgressIndicator extends Application
{
public static void main(String[] args)
{
launch(args);
}
@Override
public void start(Stage primaryStage)
{
final ProgressIndicator pi = new ProgressIndicator();
Button b = new Button("Show ProgressIndicator");
b.setOnAction(new EventHandler<ActionEvent>()
{
@Override
public void handle(ActionEvent actionEvent)
{
pi.setVisible(true);
}
});
StackPane mp = new StackPane();
mp.getChildren().addAll(pi, b);
Scene scene = new Scene(mp, 320, 480);
primaryStage.setScene(scene);
pi.setVisible(false); //doesn't work
primaryStage.show();
//pi.setVisible(false); //works
}
}
It works only if I do "setVisible(false)" AFTER showing the stage.
Here my test code:
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.ProgressIndicator;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class TestProgressIndicator extends Application
{
public static void main(String[] args)
{
launch(args);
}
@Override
public void start(Stage primaryStage)
{
final ProgressIndicator pi = new ProgressIndicator();
Button b = new Button("Show ProgressIndicator");
b.setOnAction(new EventHandler<ActionEvent>()
{
@Override
public void handle(ActionEvent actionEvent)
{
pi.setVisible(true);
}
});
StackPane mp = new StackPane();
mp.getChildren().addAll(pi, b);
Scene scene = new Scene(mp, 320, 480);
primaryStage.setScene(scene);
pi.setVisible(false); //doesn't work
primaryStage.show();
//pi.setVisible(false); //works
}
}
- duplicates
-
JDK-8095968 ProgressIndicator in indeterminate mode is not spinning
-
- Resolved
-