CodeName OneShai Almog11 min readintermediate
One App, More Than One Native Window
Summary
Codename One now supports true native desktop windows via a new `Window` class that separates per‑surface state (paint queue, input routing, native peers) from the global `Display`. The change adds a `PaintSurface` abstraction, platform‑specific window back‑ends (AWT/Swing, Direct2D, GTK, UIWindowScene), and a migration path for components that assumed a single `Form`. Initial release has some UI…
- A `Window` class implements `TopLevelContainer`, allowing multiple OS‑level windows on Java SE, Windows, Linux, and Mac Catalyst while keeping `Form` as the single‑window mobile model.
- State that was previously global (current form, graphics target, paint queue) is now encapsulated in a per‑window `PaintSurface`, enabling independent repaint and input handling.
- Input events now carry a window ID, preserving compatibility for the main surface (ID 0) and allowing the desktop ports to route events correctly.
- Platform implementations:
Enabling true multi‑window support brings Codename One closer to native desktop ergonomics, allowing developers to build richer IDE‑style or multi‑panel applications without resorting to custom in‑form layouts. The architectural split between global app state and per‑surface state also paves the wa…
7/10