Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Cannot Reproduce
    • Affects Version/s: fx2.1
    • Fix Version/s: 7u6
    • Component/s: javafx
    • Labels:
    • Environment:

      XP, NB 7.1, FX 2.0.3

      Description

      Using the Builders to create a JavaFX Node, the style functions throw an error on run time
      Example:


          private Slider getSlider(double min, double max, double value, double width, Orientation or, Property bind, String style) {
              final Slider s = SliderBuilder.create().min(min).max(max).value(value).blockIncrement(0.1).orientation(or).build();
              s.getStyleClass().add(style);

              s.valueProperty().bindBidirectional(bind);
              if (s.getOrientation().equals(Orientation.HORIZONTAL)) {
                  s.setPrefWidth(width);
              } else {
                  s.setPrefHeight(width);
              }
              return s;
          }

      The above code will work because I have to add the style class after the Slider was created..

      It won't work if I do it like so


          private Slider getSlider(double min, double max, double value, double width, Orientation or, Property bind, String style) {
              final Slider s = SliderBuilder.create().style(style).styleclass(style).min(min).max(max).value(value).blockIncrement(0.1).orientation(or).build();
          // s.getStyleClass().add(style);

              s.valueProperty().bindBidirectional(bind);
              if (s.getOrientation().equals(Orientation.HORIZONTAL)) {
                  s.setPrefWidth(width);
              } else {
                  s.setPrefHeight(width);
              }
              return s;
          }

      both .

      .style(style)
      .styleclass(style)

      seem to be ignored...

      Perhaps this is a Netbeans thing ????

        Attachments

          Activity

            People

            • Assignee:
              dgrieve David Grieve (Inactive)
              Reporter:
              bockymurpjfx bockymurphy (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: