I want to use the new controlsFX controls that I downloaded from the controlsfx-8.40.10 page official and I have installed it in SceneBuilder although some controls do not appear as PopOver
I have also downloaded the repository and I have opened it in netbeans as a new project:
Then I opened the sub-project 'controlsfx' and copied the 'Source Packages' to my particular project:
My project is a miniprogram that only shows a controlFX named CustomTextField
:
package pruebacontrolsfx;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
import org.controlsfx.control.textfield.CustomTextField;
public class PruebaControlsFX extends Application {
@Override
public void start(Stage primaryStage) {
CustomTextField customField = new CustomTextField();
customField.setPromptText("Introduce texto");
StackPane root = new StackPane();
root.getChildren().add(customField); // genera un error ¿por qué?
Scene scene = new Scene(root, 300, 250);
primaryStage.setTitle("Hello World!");
primaryStage.setScene(scene);
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
But when executing it, an error appears just when I add the control CustomTextField
to a container StackPane
What am I doing wrong?