Class MegalodonteApplication

java.lang.Object
javafx.application.Application
megalodonte.application.MegalodonteApplication
Direct Known Subclasses:
JavaFXHost

public abstract class MegalodonteApplication extends javafx.application.Application
Base class for an app's own JavaFX entry point.

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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final void
    start(javafx.stage.Stage primaryStage)
     

    Methods inherited from class javafx.application.Application

    getHostServices, getParameters, getUserAgentStylesheet, init, launch, launch, notifyPreloader, setUserAgentStylesheet, stop

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MegalodonteApplication

      public MegalodonteApplication()
  • Method Details

    • start

      public final void start(javafx.stage.Stage primaryStage)
      Specified by:
      start in class javafx.application.Application