Legacy UI integration Swing or JavaFX


#1

Hi,

I would like to integrate Grafana in a Java (JDK 1.8) based legacy desktop application. Do you see a chance to operate Grafana UI in a desktop application probably in a Web component? Do you have any success stories or considerations for this?

Thanks for any pointers
Thomas


#2

I gave it a try via a webview panel from JavaFx, it is working nearly 100% beside of some color problems for the grid and the samples. I assume there is a special css setting problem, do you have an idea what might be wrong?

Good in firefox:

Bad in webview:

This is the code for loading:

package test;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.scene.web.*;
import javafx.stage.Stage;

public final class TestBrowser extends Application {
   public static void main(String[] args) {
           launch(args);
       }

       @Override
       public void start(Stage stage) throws Exception {
           stage.setTitle("JavaFX: WebView");

           WebView webView = new WebView();
           WebEngine webEngine = webView.getEngine();

           String url = "http://192.168.188.87:3000/dashboard/db/host-overview?orgId=1";
           webEngine.load(url);

           StackPane sp = new StackPane();
           sp.getChildren().add(webView);

           Scene root = new Scene(sp);

           stage.setScene(root);
           stage.show();
       }
   }