Multi-Window Chat App in Compose Desktop | Kotlin Desktop #13
32views
1likes
017:08
T
Taught by Celeste AI - AI Coding Coach
View on YouTubeDescription
Build a multi-window chat app with Kotlin Compose Desktop! Learn how to use the application composable for multiple windows, create dynamic
windows with for loops and key(), share state across windows with mutableStateListOf, add a system tray icon, and control window position with
rememberWindowState.
What You'll Learn:
- application composable for managing app lifecycle with multiple windows
- Window composable with rememberWindowState for position and size
- Dynamic window creation using for loops over mutable state lists
- key() composable for stable identity tracking of dynamic windows
- Tray composable for system tray icon with dropdown menu
- BufferedImage and Java 2D for programmatic tray icon creation
- mutableStateListOf and mutableStateMapOf for shared cross-window state
- LaunchedEffect for auto-scroll and auto-reply
- onPreviewKeyEvent for Enter-to-send keyboard handling
Timestamps:
0:00 - Introduction
0:15 - Preview: What We're Building
0:45 - Project Setup (Gradle, Compose Dependencies)
2:14 - Chat Data (Contact, Message, ChatState)
4:28 - Contact List (LazyColumn, ContactRow, Status Dots)
7:06 - Chat Window (Messages, Input Bar, Auto-Reply)
10:59 - Main & Compile (Tray, Window, Dynamic Windows)
14:04 - Live Demo: Multi-Window Chat in Action
15:08 - Recap & Key Takeaways
16:08 - Thanks for Watching
Key Takeaways:
1. application — Manages app lifecycle, multiple Window calls create multiple windows
2. Dynamic Windows — Loop over state to create windows, key() ensures proper identity
3. Shared State — mutableStateListOf and mutableStateMapOf share data across windows
4. Tray — System tray icon with menu, persists when windows are closed
5. Window State — rememberWindowState controls position and size, stagger to prevent overlap
Previous Lesson:
Lesson 12: Animations
https://youtube.com/...
Next Lesson:
Lesson 14: Navigation (coming soon)
Tech Stack:
Kotlin 2.1, Compose Multiplatform 1.7.3, Material3
Multi-Window API, System Tray, Shared State
Gradle 8.10, JVM 17+
Source Code: https://github.com/GoCelesteAI/kotlin_desktop_multi_window
Taught by CelesteAI
If you found this helpful, please like and subscribe for more Kotlin Desktop tutorials!
#kotlin #compose #desktop #material3 #multiwindow #tray #dynamicwindows #sharedstate #tutorial #programming
Tags
kotlin, compose multiplatform, compose desktop, material3, multi-window, multiple windows, system tray, tray icon, dynamic windows, key
composable, shared state, mutableStateListOf, rememberWindowState, window management, chat app, jetbrains compose, kotlin tutorial, desktop app,
jvm, composable
Back to tutorialsOpen in YouTube
Duration
17:08
Published
February 22, 2026
Added to Codegiz
March 15, 2026