I'm new to JavaFX. I'm using the following code to load my local HTML Page which uses Bootstrap, Angular etc.
public class AppLauncher extends Application {
public static void main(String[] args) {
System.setProperty("sun.net.http.allowRestrictedHeaders", "true");
launch(args);
}
@Override
public void start(Stage stage) {
WebView webview = new WebView();
webview.getEngine().load(AppLauncher.class.getResource("/dashboard.html").toExternalForm());
stage.setScene(new Scene(webview));
stage.show();
}
}
Since my Java script have XHRs from diffrent domain, I've configured it to allow cross-domain requests.
Everything works fine when I run it from my Eclipse.
I need to have an executable so I used maven-shade-plugin
along with launch4j-maven-plugin
.
The executable is geting created perfectly and can open my HTML page.
But the problem is the UI does not render the font-awesome
icons I have in my HTML page (also not from the created jar).
I have fa-angle-down
, fa-bell-o
, fa-search
in the page. None of them were displayed.
Please see images When running from Eclipse and When running from exe/jar
What is causing it not to render the fa icons when its converted into an executable jar or an exe?