Install controlsFX in netbeans

2

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?

    
asked by Oundroni 06.03.2016 в 19:11
source

1 answer

1

One option may be to add .jar to your project, go to the official page link

Download the current version

  

Getting ControlsFX

     

For users of JavaFX 8u40 and greater, download ControlsFX   8.40.10 .

Simply unzip the file which will contain several .jar, the one we need is controlsfx-{version}.jar

In your project, open the Libraries folder, right click and select the option Add JAR/Folder

By doing this procedure you can now add the import without problem:

and start your project:

    
answered by 06.03.2016 / 19:55
source