Annotation Interface MainWindow


@Target(TYPE) @Retention(RUNTIME) @Inherited public @interface MainWindow
Marks a JFrame subclass as the migrated app's main window. The annotated frame renders inline as the content of a MainWindowRoute-extending Vaadin route, peered over SJPanel (Div-backed) instead of the regular SJFrame (Dialog-backed). At most one @MainWindow-annotated class may be instantiated per JVM — detected lazily via the JFrame ctor's CAS check.

Per D_jframe_as_route:

  • Inherited — user-code subclasses inherit the annotation from their @MainWindow-annotated parent.
  • Target(TYPE) — class-level only.
  • Retention(RUNTIME) — visible to the ctor's isAnnotationPresent check.

Typical usage:

@MainWindow
public class MyMainFrame extends JFrame { ... }

public static void mainUI() {
    new MyMainFrame().setVisible(true);
}