problem with builders

Jose Martinez jmartine_1026 at
Mon Jul 16 18:55:21 PDT 2012

I am having a problem with some of the builders.... maybe I'm doing something wrong.  If I instantiate a builder (e.g. LabelBuilder) then if I edit it (e.g. .text("txt") ) then the compiler complaints that the build() method is not present.  Its as if the .text() method does not returns a LabelBuilder.  It does not happen with all builders, I have not tested enough to pick up on a pattern.

Here are some examples.....

//will not compile
        LabelBuilder lb = LabelBuilder.create();
        Label label = lb.text("txt").build();
        StackPaneBuilder spb = StackPaneBuilder.create();
        StackPane sp = spb.alignment(Pos.CENTER).build();
//will not compile
        RectangleBuilder rb = RectangleBuilder.create();
        Rectangle r = rb.fill(Color.ALICEBLUE).build();


More information about the openjfx-dev mailing list