:wave: all! I'm new to Kotlin and I am trying to u...
# coroutines
c
👋 all! I'm new to Kotlin and I am trying to use coroutines and Swing - the above code sort of works, but doesn't update the table ui until it has been pressed a few times - am I doing this right? https://github.com/TypeError/Bookmarks/blob/177801633a1e8f51ae8aad2c5e1bf034b83a9faa/src/BookmarkTab.kt#L158
d
First thing I noticed is that you are accessing
repeatInTable
(which is a Swing component) from the IO thread. Swing is not threadsafe. Then, instead of launching another job using
launch
, you can just use
Copy code
withContext(Dispatchers.Swing) {
}
c
Thanks so much! I'll give those a try!