ComposeWindow


class ComposeWindow : JFrame

kotlin.Any
   ↳ java.awt.Component
     ↳ java.awt.Container
       ↳ java.awt.Window
         ↳ java.awt.Frame
           ↳ javax.swing.JFrame
             ↳ androidx.compose.ui.awt.ComposeWindow

ComposeWindow is a window for building UI using Compose for Desktop. ComposeWindow inherits javax.swing.JFrame.

Summary

Public constructors

ComposeWindow(graphicsConfiguration: GraphicsConfiguration?)

Public functions

open Component
add(component: Component)
open Unit
open Unit
open Unit
open Unit
Unit
onRenderApiChanged(action: () -> Unit)

Registers a task to run when the rendering API changes.

open Unit
remove(component: Component)
open Unit
open Unit
open Unit
Unit

Composes the given composable into the ComposeWindow.

Unit
@ExperimentalComposeUiApi
setContent(
    onPreviewKeyEvent: (KeyEvent) -> Boolean,
    onKeyEvent: (KeyEvent) -> Boolean,
    content: @Composable FrameWindowScope.() -> Unit
)

Composes the given composable into the ComposeWindow.

open Unit
open Unit

Public properties

Boolean

true if the window is minimized to the taskbar, false otherwise

Boolean

true if background of the window is transparent, false otherwise Transparency should be set only if window is not showing and isUndecorated is set to true, otherwise AWT will throw an exception.

WindowPlacement
GraphicsApi

Returns low-level rendering API used for rendering in this ComposeWindow.

Long

Retrieve underlying platform-specific operating system handle for the root window where ComposeWindow is rendered.

Inherited functions

From java.awt.Component
open Boolean
action(p0: Event, p1: Any)

This function is deprecated. Deprecated in Java

open Unit
open Unit
open Unit
open Unit
open Unit
open Unit
open Unit
open Rectangle

This function is deprecated. Deprecated in Java

open Int
open Int
checkImage(p0: Image, p1: Int, p2: Int, p3: ImageObserver)
open AWTEvent
open operator Boolean
open Boolean
contains(p0: Int, p1: Int)
open Image
open Image
createImage(p0: Int, p1: Int)
open VolatileImage
open VolatileImage
open Unit

This function is deprecated. Deprecated in Java

Unit
Unit
open Unit

This function is deprecated. Deprecated in Java

open Unit

This function is deprecated. Deprecated in Java

Unit
open Unit
open Unit
firePropertyChange(p0: String, p1: Any, p2: Any)
open Unit
open Unit
firePropertyChange(p0: String, p1: Byte, p2: Byte)
open Unit
firePropertyChange(p0: String, p1: Char, p2: Char)
open Unit
open Unit
firePropertyChange(p0: String, p1: Float, p2: Float)
open Unit
firePropertyChange(p0: String, p1: Int, p2: Int)
open Unit
firePropertyChange(p0: String, p1: Long, p2: Long)
open Unit
firePropertyChange(p0: String, p1: Short, p2: Short)
open Int
getBaseline(p0: Int, p1: Int)
open Component.BaselineResizeBehavior
open Rectangle
open Rectangle
open ColorModel
open Array<ComponentListener>
open Array<FocusListener>
open FontMetrics
open GraphicsConfiguration
open Array<HierarchyBoundsListener>
open Array<HierarchyListener>
open Array<InputMethodListener>
open InputMethodRequests
open Array<KeyListener>
open Point
open Point
open Point
open Array<MouseListener>
open Array<MouseMotionListener>
open Point
open Array<MouseWheelListener>
open Array<PropertyChangeListener>
open Array<PropertyChangeListener>
open Dimension
open Dimension
Any
open Boolean
gotFocus(p0: Event, p1: Any)

This function is deprecated. Deprecated in Java

open Boolean

This function is deprecated. Deprecated in Java

open Boolean
open Boolean
imageUpdate(p0: Image, p1: Int, p2: Int, p3: Int, p4: Int, p5: Int)
open Boolean
inside(p0: Int, p1: Int)

This function is deprecated. Deprecated in Java

open Boolean
open Boolean
open Boolean
open Boolean
open Boolean
open Boolean

This function is deprecated. Deprecated in Java

open Boolean
open Boolean
open Boolean
open Boolean
open Boolean
open Boolean
open Boolean
keyDown(p0: Event, p1: Int)

This function is deprecated. Deprecated in Java

open Boolean
keyUp(p0: Event, p1: Int)

This function is deprecated. Deprecated in Java

open Unit
open Unit
open Unit
open Point

This function is deprecated. Deprecated in Java

open Boolean
lostFocus(p0: Event, p1: Any)

This function is deprecated. Deprecated in Java

open Boolean
mouseDown(p0: Event, p1: Int, p2: Int)

This function is deprecated. Deprecated in Java

open Boolean
mouseDrag(p0: Event, p1: Int, p2: Int)

This function is deprecated. Deprecated in Java

open Boolean
mouseEnter(p0: Event, p1: Int, p2: Int)

This function is deprecated. Deprecated in Java

open Boolean
mouseExit(p0: Event, p1: Int, p2: Int)

This function is deprecated. Deprecated in Java

open Boolean
mouseMove(p0: Event, p1: Int, p2: Int)

This function is deprecated. Deprecated in Java

open Boolean
mouseUp(p0: Event, p1: Int, p2: Int)

This function is deprecated. Deprecated in Java

open Unit
move(p0: Int, p1: Int)

This function is deprecated. Deprecated in Java

open Unit

This function is deprecated. Deprecated in Java

open Unit
open Boolean
open Boolean
prepareImage(p0: Image, p1: Int, p2: Int, p3: ImageObserver)
open Unit
open Unit
open Unit
open Unit
open Unit
open Unit
open Unit
open Unit
open Unit
open Unit
open Unit
open Unit
open Unit
open Unit
open Unit
open Unit
open Unit
open Unit
open Unit
open Unit
open Unit
repaint(p0: Int, p1: Int, p2: Int, p3: Int)
open Unit
open Boolean
open Unit
open Boolean
open Boolean
open Boolean
open Boolean
open Unit

This function is deprecated. Deprecated in Java

open Unit
resize(p0: Int, p1: Int)

This function is deprecated. Deprecated in Java

open Unit
open Unit
open Unit
open Unit
open Unit

This function is deprecated. Deprecated in Java

open Dimension

This function is deprecated. Deprecated in Java

open String
open Unit
open Unit
open Unit
From java.awt.Container
open Unit
add(p0: Component, p1: Any)
open Component
add(p0: Component, p1: Int)
open Component
add(p0: String, p1: Component)
open Unit
add(p0: Component, p1: Any, p2: Int)
open Unit
open Unit
open Boolean
open Int

This function is deprecated. Deprecated in Java

open Unit

This function is deprecated. Deprecated in Java

open Unit
open Component
open Component
findComponentAt(p0: Int, p1: Int)
open Float
open Float
open Component
open Component
open Component
getComponentAt(p0: Int, p1: Int)
open Int
open Int
open Array<Component>
open Array<ContainerListener>
open Insets
open LayoutManager
open Dimension
open Dimension
open Point
open Dimension
open Insets

This function is deprecated. Deprecated in Java

open Unit
open Boolean
open Boolean
open Boolean
open Unit

This function is deprecated. Deprecated in Java

open Unit
list(p0: PrintStream, p1: Int)
open Unit
list(p0: PrintWriter, p1: Int)
open Component
locate(p0: Int, p1: Int)

This function is deprecated. Deprecated in Java

open Dimension

This function is deprecated. Deprecated in Java

open Unit
open Dimension

This function is deprecated. Deprecated in Java

open Unit
open Unit
open Unit
open Unit
remove(p0: Int)
open Unit
open Unit
open Unit
open Unit
open Unit
open Unit
open Unit
From java.awt.Frame
open Unit
open Int

This function is deprecated. Deprecated in Java

open Int
open Image
open Unit
open Unit
open Unit

This function is deprecated. Deprecated in Java

open Unit
From javax.swing.JFrame
open Unit
addImpl(p0: Component, p1: Any, p2: Int)
open JRootPane
open Unit
open AccessibleContext
open Container
open Component
open Graphics
@BeanProperty(bound = false)
getGraphics()
open JMenuBar
open JLayeredPane
open JRootPane
@BeanProperty(bound = false, hidden = true, description = "the RootPane object for this frame.")
getRootPane()
open Boolean
open String
open Unit
open Unit
repaint(p0: Long, p1: Int, p2: Int, p3: Int, p4: Int)
open Unit
@BeanProperty(bound = false, hidden = true, description = "The client area of the frame where child components are normally inserted.")
setContentPane(p0: Container)
open Unit
@BeanProperty(bound = false, hidden = true, description = "A transparent pane used for menu rendering.")
setGlassPane(p0: Component)
open Unit
open Unit
@BeanProperty(bound = false, hidden = true, description = "The menubar for accessing pulldown menus from this frame.")
setJMenuBar(p0: JMenuBar)
open Unit
@BeanProperty(bound = false, hidden = true, description = "The pane that holds the various frame layers.")
setLayeredPane(p0: JLayeredPane)
open Unit
open Unit
open Unit
@BeanProperty(hidden = true, description = "Whether the add and setLayout methods are forwarded")
setRootPaneCheckingEnabled(p0: Boolean)
open Unit
From java.awt.Window
open Unit
open Unit
open Unit
open Unit
open Unit
open Unit

This function is deprecated. Deprecated in Java

open Unit

This function is deprecated. Deprecated in Java

open Unit
open Unit
final Container
open Component
open MutableSet<AWTKeyStroke>
open MutableList<Image>
open Array<T>
open Component
open Array<Window>
open Window
open Toolkit
open Array<WindowFocusListener>
open Array<WindowListener>
open Array<WindowStateListener>
open Unit

This function is deprecated. Deprecated in Java

open Boolean
open Boolean
Boolean
open Boolean
open Boolean
open Boolean
open Boolean
open Unit
open Unit
open Boolean

This function is deprecated. Deprecated in Java

open Unit
open Unit
open Unit
open Unit
open Unit
open Unit
open Unit
reshape(p0: Int, p1: Int, p2: Int, p3: Int)

This function is deprecated. Deprecated in Java

open Unit
open Unit
setBounds(p0: Int, p1: Int, p2: Int, p3: Int)
open Unit
open Unit
open Unit
setLocation(p0: Int, p1: Int)
open Unit
open Unit
open Unit
open Unit
setSize(p0: Int, p1: Int)
open Unit

This function is deprecated. Deprecated in Java

open Unit
open Unit

Public constructors

ComposeWindow

ComposeWindow(graphicsConfiguration: GraphicsConfiguration? = null)
Parameters
graphicsConfiguration: GraphicsConfiguration? = null

the GraphicsConfiguration that is used to construct the new window. If null, the system default GraphicsConfiguration is assumed.

Public functions

add

open fun add(component: Component): Component

addMouseListener

open fun addMouseListener(listener: MouseListener): Unit

addMouseMotionListener

open fun addMouseMotionListener(listener: MouseMotionListener): Unit

addMouseWheelListener

open fun addMouseWheelListener(listener: MouseWheelListener): Unit

dispose

open fun dispose(): Unit

onRenderApiChanged

fun onRenderApiChanged(action: () -> Unit): Unit

Registers a task to run when the rendering API changes.

remove

open fun remove(component: Component): Unit

removeMouseListener

open fun removeMouseListener(listener: MouseListener): Unit

removeMouseMotionListener

open fun removeMouseMotionListener(listener: MouseMotionListener): Unit

removeMouseWheelListener

open fun removeMouseWheelListener(listener: MouseWheelListener): Unit

setContent

fun setContent(content: @Composable FrameWindowScope.() -> Unit): Unit

Composes the given composable into the ComposeWindow.

Parameters
content: @Composable FrameWindowScope.() -> Unit

Composable content of the ComposeWindow.

setContent

@ExperimentalComposeUiApi
fun setContent(
    onPreviewKeyEvent: (KeyEvent) -> Boolean = { false },
    onKeyEvent: (KeyEvent) -> Boolean = { false },
    content: @Composable FrameWindowScope.() -> Unit
): Unit

Composes the given composable into the ComposeWindow.

Parameters
onPreviewKeyEvent: (KeyEvent) -> Boolean = { false }

This callback is invoked when the user interacts with the hardware keyboard. It gives ancestors of a focused component the chance to intercept a KeyEvent. Return true to stop propagation of this event. If you return false, the key event will be sent to this onPreviewKeyEvent's child. If none of the children consume the event, it will be sent back up to the root using the onKeyEvent callback.

onKeyEvent: (KeyEvent) -> Boolean = { false }

This callback is invoked when the user interacts with the hardware keyboard. While implementing this callback, return true to stop propagation of this event. If you return false, the key event will be sent to this onKeyEvent's parent.

content: @Composable FrameWindowScope.() -> Unit

Composable content of the ComposeWindow.

setResizable

open fun setResizable(value: Boolean): Unit

setUndecorated

open fun setUndecorated(value: Boolean): Unit

Public properties

isMinimized

var isMinimizedBoolean

true if the window is minimized to the taskbar, false otherwise

isTransparent

var isTransparentBoolean

true if background of the window is transparent, false otherwise Transparency should be set only if window is not showing and isUndecorated is set to true, otherwise AWT will throw an exception.

placement

var placementWindowPlacement

renderApi

val renderApiGraphicsApi

Returns low-level rendering API used for rendering in this ComposeWindow. API is automatically selected based on operating system, graphical hardware and SKIKO_RENDER_API environment variable.

windowHandle

val windowHandleLong

Retrieve underlying platform-specific operating system handle for the root window where ComposeWindow is rendered. Currently returns HWND on Windows, Window on X11 and NSWindow on macOS.