Hello guys, in my early days programming in SWT I ...
# compose-desktop
h
Hello guys, in my early days programming in SWT I created a UI with Tabs, here is an example https://www.roseindia.net/tutorials/swt/create-tabs.shtml Is there a way to do the same in compose for desktop? Any link to documentation or example would be nice. Or other reason why not to go that way.
d
Something like this?
Copy code
@Composable
fun MyAppTabs() {
    var tabIndex by remember { mutableStateOf(0) }
    val tabTitles = listOf("Hello", "There", "World")

    Column {
        TabRow(selectedTabIndex = tabIndex) {
            tabTitles.forEachIndexed { index, title ->
                Tab(
                    selected = tabIndex == index,
                    onClick = { tabIndex = index },
                    text = { Text(text = title) }
                )
            }
        }
        when (tabIndex) {
            0 -> Text("Hello content")
            1 -> Text("There content")
            2 -> Text("World content")
        }
    }
}
Source: https://www.rockandnull.com/jetpack-compose-swipe-pager/
h
Thanks I think this will do the work!
🎉 2
k
Interesting! Thankyou!