Skip to content

Commit e8e8231

Browse files
committed
Added ComposePanel correctly
1 parent fa067f6 commit e8e8231

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

app/src/processing/app/ui/DownloadsManager.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package processing.app.ui
22

3+
import androidx.compose.foundation.layout.Box
34
import androidx.compose.material.Text
45
import androidx.compose.runtime.Composable
56
import androidx.compose.runtime.mutableStateListOf
@@ -20,24 +21,23 @@ class DownloadsManager {
2021
fun startup() {
2122
Messages.log("START UP :)")
2223
SwingUtilities.invokeLater {
23-
JFrame().apply {
24-
ComposePanel().apply {
25-
setContent {
26-
DownloadsManager()
27-
}
28-
this@apply.add(this)
24+
val composePanel = ComposePanel().apply {
25+
setContent {
26+
DownloadsManager()
2927
}
28+
}
29+
JFrame().apply {
30+
add(composePanel)
3031
pack()
3132
isVisible = true
3233
requestFocus()
3334
}
34-
3535
}
3636
}
3737

3838
@Composable
3939
fun DownloadsManager() {
40-
Window(onCloseRequest = { /*TODO*/ }, title = windowTitle) {
40+
Box() {
4141
Text("Hello!")
4242
}
4343
}

0 commit comments

Comments
 (0)