Skip to content

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…

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 FXLoade…

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.…

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 f…

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. Als…

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…

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