Skip to content
Advertisement

Tag: javafx

Add JavaFX jmods to java –list-modules

Preface: I need to open .jar files which requires Java and JavaFX. I have installed both Java (from Oracle website) and JavaFX (SDK from openjfx website). I have added environment variables by updating /etc/environment file, and adding JAVAFX_HOME=”path/to/JavaFX”. /etc/environment file looks like: For now, I can get a .jar file running by executing: java –module-path $JAVAFX_HOME –add-modules ALL-MODULE-PATH -jar myfile.jar

CDI events fire() create new observers instances

I’m writing a JavaFX application (JavaSE) with CDI (Weld). I’m trying to use CDI Events to replace the awful event system of JavaFX (JavaFX Properties). I was able to let CDI create my JavaFX controllers properly. It means that when a FXML is loaded, the controller is created by CDI (using FXLoader.setControllerFactory). Unfortunately as soon as I added an @Observes

JavaFX Spinner keeps going after removed from scene

I appeared to have discovered a problem with JavaFX Spinner in JavaFX JDK Linux 1.8.0_144. If you are pressing on the increment or decrement button whilst a spinner is removed from the scene the spinner keeps going. Output Code Analysis In com.sun.javafx.scene.control.skin.SpinnerSkin<T> com.sun.javafx.scene.control.behavior.SpinnerBehavior.stopSpinning() is only ever called on MOUSE_RELEASED event. It appears when spinner is removed from the scene this

JavaFX and Maven in Intellij: JAVA_HOME set but “Unrecognized option –module-path” error persisting

Using Maven and JavaFX in Intellij (2019.1). I have been following this tutorial. I have a curious error that keeps occurring – every time I keep running the javafx:run plugin, it fails, giving this error: However, when I put the executable in the javafx-maven-plugin (<executable>”C:Program FilesJavajdk-12.0.1binjava.exe”</executable>) it works. I am on Windows and have set the JAVA_HOME system environment variable

Bundle JavaFX app with openjdk 11 + runtime

I’ve created a small HelloWorld Java app that relies on OpenJDK 11 and JavaFX. The app is packaged in a jar file which can only be run if I have installed Java 11 and JavaFX on my system separately. Now I’d like to convert my jar into a self-contained Java application which includes JavaFX and a fully-functional Java runtime environment.

Can’t run a simple demo of a Media class

I found a video on YouTube about using Media class, but when I try to do it – it gives me an error. Could somebody tell me whats wrong? Here’s the code, exactly how I saw it in the video: And here’s the error I get: Answer root.getChildren().add(root); you can’t add root to itself. Also as a simple printout can

How do I add a Splash screen to a main program in javafx?

I have 2 files, Splash.java and Main.java. Here are the 2 codes: Splash.java And Main.java Now I want to make a Splash screen appear before the main program is launched. How do I modify Main.java so that my code can show the splash screen for its entire duration before fading away and opening the main program? Answer I made a

Cancel edit in javafx tableview

I am fairly new in JavaFX. I have a table having multiple columns and a refresh button in each row. I am trying to set the old value in the edited cells whenever I click Refresh button. One idea is Passing the old value through a global variable to refresh button and set it. I can get the old value

Advertisement