Changing BorderPane contraints (adding and removing same component) causes component to disappear

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P5
    • 8
    • Affects Version/s: fx2.0
    • Component/s: javafx
    • Environment:

      release beta build 42 - 32 bit
      windows 7 - Home Premium 64 bits

      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.Button;
      import javafx.scene.layout.BorderPane;
      import javafx.scene.paint.Color;
      import javafx.stage.Stage;
       
      public class MainWindow extends Application {
       
      public static void main(String[] args) {
      Application.launch(args);
      }
       
      public void start(Stage s) {
      BorderPane workArea = new BorderPane();
       
      Button button = new Button("where am i?");
       
      Scene scene = new Scene(workArea, 800, 600, Color.TRANSPARENT);
      s.setScene(scene);
      s.show();
       
      workArea.setCenter(button);
      workArea.getChildren().remove(button);
      workArea.setLeft(button);
      workArea.getChildren().remove(button);
      workArea.setCenter(button);
      }
       

      Expected behavior:

      Control "button" should be visible on the center position of the BorderPane

      Current behavior:

      "button" isn't visible after running the snippet

      Workaround:

      Remove the component with setTop(null)/setCenter(null) or wherever the component the was

            Assignee:
            Martin Sládeček
            Reporter:
            J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: