Details
Description
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
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