functional/ControlsTests/src/javafx/scene/control/test/utils/ptables/TextFieldEventsCounter.java

Print this page

        

@@ -28,13 +28,11 @@
 import javafx.beans.property.SimpleIntegerProperty;
 import javafx.beans.value.ChangeListener;
 import javafx.beans.value.ObservableValue;
 import javafx.scene.Node;
 import javafx.scene.control.Label;
-import javafx.scene.control.LabelBuilder;
 import javafx.scene.control.TextField;
-import javafx.scene.control.TextFieldBuilder;
 import static javafx.scene.control.test.utils.ptables.StaticLogger.*;
 import javafx.scene.control.test.utils.ptables.TextFieldEventsCounter.Count;
 import javafx.scene.layout.HBox;
 import javafx.scene.text.Text;
 

@@ -52,12 +50,15 @@
         if (counterName == null) {
             throw new IllegalArgumentException("Counter name cannot be null.");
         }
         try {
             this.counterName = counterName;
-            Label label = LabelBuilder.create().text(counterName + " : ").prefWidth((new Text(counterName + " : ")).getBoundsInParent().getWidth() + 30).build();
-            final TextField tf = TextFieldBuilder.create().text("0").prefWidth(50).id(counterName.toUpperCase() + COUNTER_SUFFIX).build();
+            Label label = new Label(counterName + " : ");

+            label.setPrefWidth((new Text(counterName + " : ")).getBoundsInParent().getWidth() + 30);

+            final TextField tf = new TextField("0");

+            tf.setPrefWidth(50);

+            tf.setId(counterName.toUpperCase() + COUNTER_SUFFIX);

             counter.addListener(new ChangeListener<Number>() {
                 public void changed(ObservableValue<? extends Number> ov, Number t, Number t1) {
                     log("Counter " + counterName + ": new value : <" + t1 + ">.");
                     tf.setText(t1.toString());
                 }