Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8127487

[Linux] setScene doesn't affect immediately.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: fx2.1
    • Fix Version/s: 7-pool
    • Component/s: javafx
    • Labels:
    • Environment:

      2.1.0b10.
      Linux ubuntu.

      Description

      I use next code, where using buttons i change current scene.

      import javafx.application.Application;
      import javafx.event.ActionEvent;
      import javafx.event.EventHandler;
      import javafx.scene.Scene;
      import javafx.scene.control.Button;
      import javafx.scene.layout.VBox;
      import javafx.stage.Stage;

      public class JavaFX_ScenesChanging extends Application {

          public static void main(String[] args) {
              launch(args);
          }

          @Override
          public void start(final Stage stage) throws Exception {
              Button b1 = new Button("Button 1");
              VBox vb = new VBox();
              vb.getChildren().add(b1);
              final Scene scene1 = new Scene(vb, 200, 200);

              Button b2 = new Button("Button 2");
              VBox vb2 = new VBox();
              vb2.getChildren().add(b2);
              final Scene scene2 = new Scene(vb2, 200, 200);

              b1.setOnAction(new EventHandler<ActionEvent>() {

                  @Override
                  public void handle(ActionEvent t) {
                      stage.setScene(scene2);
                  }
              });

              b2.setOnAction(new EventHandler<ActionEvent>() {

                  @Override
                  public void handle(ActionEvent t) {
                      stage.setScene(scene1);
                  }
              });

              stage.setScene(scene1);
              stage.show();
          }
      }

      When I press button, "old" scene stays on stage with pressed state of button and it [scene] is already inactive. To see "new" scene i need to drag and drop window.
      Excuse me, if such bug already exists, in part, where scene setting is asynchroniuos. May be related to RT-19320.

        Attachments

          Activity

            People

            • Assignee:
              radko Radko Najman (Inactive)
              Reporter:
              akirov Alexander Kirov (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: