I'm trying to use RichTextFX but when I do try to use it I get a long error (see below). I'm using IntelliJ IDEA 2018.3.4, JDK 8 and Gradle version 4.8.1. My current way of trying to install it is I downloaded the jar (richtextfx-0.9.2.jar) and move it into a folder in the project. I then add the jar as a library and save. Then I go to my JavaFX file, and make a new Code AreaCodeArea c = new CodeArea();
This will result in a large error. I think there is an error with gradle installing. I haven't used it before so I'm very new at it.
I am able to use the actual files (when not compiled into a JAR) to run the demos provided. This is in a different project, and the gradle libraries are added as external libraries when the project was created. The project I'm working on however does not have these extra external libraries.
Any support on what to do would be greatly appreciated. Thanks!
There Exceptions are:
- java.lang.reflect.InvocationTargetException
- java.lang.RuntimeException: Exception in Application start method
- java.lang.NoClassDefFoundError: org/fxmisc/flowless/Virtualized
- java.lang.ClassNotFoundException: org.fxmisc.flowless.Virtualized
Test java code
package demo.javafx;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.Pane;
import javafx.stage.Stage;
import org.fxmisc.richtext.CodeArea;
public class TestRichTextFX extends Application {
@Override
public void start(Stage primaryStage) {
Pane root = new Pane();
Scene scene = new Scene(root);
CodeArea c = new CodeArea();
primaryStage.setAlwaysOnTop(true);
primaryStage.setTitle("");
primaryStage.setScene(scene);
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}