Forum Stats

  • 3,734,496 Users
  • 2,246,986 Discussions


Widgets on FXCanvas doesnt display

I am trying to write an application in eclipse. So as to use javafx components on components am using the FXCanvas. So the problem is i try the below program which creates around 500 nodes, the composite is empty. And none of the nodes are displayed.

But instead of 500 nodes, if we create 50 nodes, then the nodes are visible in the SWT Composite.

What is the problem here ?

FXCanvas canvas = new FXCanvas(swtComposite, SWT.NONE) {


      public Point computeSize(final int wHint, final int hHint, final boolean changed) {


        int width = (int) getScene().getWidth();

        int height = (int) getScene().getHeight();

        return new Point(width, height);



    Group group = new Group();

    Scene scene = new Scene(group);


    VBox container = new VBox();

    ScrollPane root = new ScrollPane(container);


    for (int i = 0; i < 500; i++) {

      container.getChildren().add(new Button("Hello_" + i));



Sign In or Register to comment.