Class MegalodonteApplication
- Direct Known Subclasses:
JavaFXHost
On Linux/GTK, Glass reports the running window's WM_CLASS as the concrete
Application subclass's fully-qualified name (confirmed empirically via
xprop WM_CLASS — javafx.application.name/MegalodonteApp.appName(String)
does not affect this, despite what the name suggests). If every app built
on this framework launched through the same shared class (JavaFXHost),
they'd all report the same WM_CLASS, and GNOME-based desktop environments (Zorin
OS included) would treat them as the same app for dock/taskbar purposes — same
icon, same grouping, regardless of which one is actually running.
Extend this with an empty subclass in your own app and pass it to
MegalodonteApp.run(Class, String[], java.util.function.Consumer, java.util.function.Consumer)
to get a WM_CLASS — and therefore a distinct taskbar icon — of your own:
public class Main {
public static class AppHost extends MegalodonteApplication {}
static void main(String[] args) {
MegalodonteApp.appName("My App");
MegalodonteApp.appIcon("/assets/app_icon.png");
MegalodonteApp.run(AppHost.class, args, Main::start, Main::onEvent);
}
}
-
Nested Class Summary
Nested classes/interfaces inherited from class javafx.application.Application
javafx.application.Application.Parameters -
Field Summary
Fields inherited from class javafx.application.Application
STYLESHEET_CASPIAN, STYLESHEET_MODENA -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class javafx.application.Application
getHostServices, getParameters, getUserAgentStylesheet, init, launch, launch, notifyPreloader, setUserAgentStylesheet, stop
-
Constructor Details
-
MegalodonteApplication
public MegalodonteApplication()
-
-
Method Details
-
start
public final void start(javafx.stage.Stage primaryStage) - Specified by:
startin classjavafx.application.Application
-