Using JFX panel inside LibreOffice extension causes Crash

Hi , I have developed an extension to open a JFX panel upon a button click.
The extension works fine on Windows but the same crashes when loaded in Ubuntu/Linux version of LibreOffice
In both the cases same version of the Oracle JDK has been used.
Please suggest on how to get away with the crash

I have developed an extension … Please suggest on how to get away with the crash

My crystal ball tells me that you have an error in line 16. Which file? My crystal ball will not tell me that.

obviously the crash is not inside the extension code… There seems to be serious issue with the JavaFX when you launch it via Libre Office. Being sarcastic doesnt help anyone. Hope you can try the scenario and put comments like that.

Just for your information JFXPanel fxPanel = new JFXPanel(); is the line which causes the crash. There is nothing fancy done here. This works absolutely fine in Windows but fails on Ubuntu/linux

Hopefully being sarcastic might help you to see problems in your questions (if you don’t try to say “I’m right, I don’t listen to you nonono!”). If you think of it, you might see it yourself.

Your question is like this: “I have a problem. I write here some very limited information about it, so that only if someone happened to also come across the same problem, those will understand and hopefully answer”. What I expected would be “here is a detailed explanation of the problem, so that everyone, even not previously having dealt with JFXPanel, could try and see; I hope that someone who might have good understanding of LibreOffice - even if not saw my problem before - would try and answer”.

Got your point. I will try to explain the scenario.

Just use the starter extension to create a sample extension.
In any button click event try to create a JFX Panel and load any website like google.com using webview.
Observation: dialog loads properly in Windows but crashes on Linux
Libre Office used: 6.2.5./ 6.3.x / 6.4.x
Oracle JDK : 1.8.0_241"
I have enabled the JRE in options tab too. So certainly not the issue there
Porblem is JVM is unable to create JFX panel itself.
If you try to debug the code shall break at line where JFX panel is created.
JFXPanel panel = new JFXPanel()
I’ll try to give the sample code too

protected void testPanel() {
try{
String url =“www.google.com”;
JFrame myFrame = new JFrame();
JFXPanel jfxPanel = new JFXPanel();
myFrame.add(jfxPanel);
PlatformImpl.setImplicitExit(false);
PlatformImpl.runLater(() → {
try {
WebView webView = new WebView();
jfxPanel.setScene(new Scene(webView));
webView.getEngine().setJavaScriptEnabled(true);
webView.getEngine().setUserDataDirectory(
new File(FileSystems.getDefault().getPath(".").toAbsolutePath().toString()));
webView.getEngine().load(url);
webView.getEngine().getLoadWorker().stateProperty().addListener((obs, oldValue, newValue) → {
if (newValue == Worker.State.SUCCEEDED) {
webView.getEngine().setOnAlert(new EventHandler<WebEvent>() {
@Override
public void handle(WebEvent arg0) {
JOptionPane.showMessageDialog(null, arg0.getData(), “Message”,
JOptionPane.INFORMATION_MESSAGE);
}

});
}
if (newValue == Worker.State.FAILED) {
JOptionPane.showMessageDialog(null, "Unable to load " + title + “. Please try relaunching the page.”, “Error”,
JOptionPane.ERROR_MESSAGE);
}
});
} catch (Exception e) {
JOptionPane.showMessageDialog(null, e.getMessage(), “Error”, JOptionPane.ERROR_MESSAGE);
}
});
myFrame.setSize(500, 500);
myFrame.setLocationRelativeTo(null);
myFrame.setTitle(title);
myFrame.setVisible(true);
}
catch(Exception e){
JOptionPane.showMessageDialog(null, e.getMessage(), “Error”, JOptionPane.ERROR_MESSAGE);
}
}

Hope I have explained the issue well. Will be grateful if someone can comeup with solution too.

Seems like it is not supported or no one has ever tried it. A blog on this topic says

Can some one from Libre Office dev please comment here