Error invoking method, failed to launch jvm

I ran into the same problem; the following worked for me and helped me make sense of those blasted “Error invoking method.” and “Failed to launch JVM” dialogs: Find your .jar file It has the same name as your Project and it’s in your application’s installation directory under AppData\Local\{ApplicationTitle}\app (shortcut: type %appdata% into explorer); if … Read more

Styling default JavaFX Dialogs

You can style your dialogs with your own css file, but for that you need to take into consideration that the dialog is in fact a new stage, with a new scene, and the root node is a DialogPane instance. So once you create some dialog instance: @Override public void start(Stage primaryStage) { Alert alert … Read more

Make portion of a text bold in a JavaFx Label or Text

It is possible to use TextFlow container from JavaFX8. Then you can easily add differently styled Text nodes inside it. TextFlow flow = new TextFlow(); Text text1=new Text(“Some Text”); text1.setStyle(“-fx-font-weight: bold”); Text text2=new Text(“Some Text”); text2.setStyle(“-fx-font-weight: regular”); flow.getChildren().addAll(text1, text2); TextFlow container will automatically wrap content Text nodes.

Line Chart Live update

Based on JewelSea’s example on AnimatedAreaChart, I modified it to make a similar example for you based on LineGraph. Please have a look at the example, hope it satisfies your need! import javafx.animation.AnimationTimer; import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.chart.LineChart; import javafx.scene.chart.NumberAxis; import javafx.scene.chart.XYChart; import javafx.stage.Stage; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.ThreadFactory; public class … Read more

How to wait for user input on JavaFX application thread without using showAndWait?

You can do so by using Platform.enterNestedEventLoop to pause the execution of the event handler and Platform.exitNestedEventLoop (available since JavaFX 9) to resume the execution: private final Object PAUSE_KEY = new Object(); private void pause() { Platform.enterNestedEventLoop(PAUSE_KEY); } private void resume() { Platform.exitNestedEventLoop(PAUSE_KEY, null); } Platform.enterNestedEventLoop returns when Platform.exitNestedEventLoop is called with the same parameter … Read more

How to add dynamic columns and rows to TableView in java fxml

What you are missing is a cellValueFactory for your columns that will tell the column what value to display in its cells. Something like this: TableView<ObservableList<String>> tableView = new TableView<>(); List<String> columnNames = dataGenerator.getNext(N_COLS); for (int i = 0; i < columnNames.size(); i++) { final int finalIdx = i; TableColumn<ObservableList<String>, String> column = new TableColumn<>( … Read more