Doesn't work well with scala-swing?
freewind opened this issue · 5 comments
freewind commented
Described here, thanks:
http://stackoverflow.com/questions/33627505/reactivex-in-scala-swing-doesnt-work
zsxwing commented
Looks this is not an RxScala issue.
freewind commented
Just found it works well with jdk1.7 & 1.8
, but failed with jdk 1.6
freewind commented
Seems like I have to add the lib "io.reactivex" % "rxswing" % "0.21.0"
, and
val eventScheduler = rx.lang.scala.JavaConversions.javaSchedulerToScalaScheduler(SwingScheduler.getInstance)
stream.observeOn(eventScheduler).subscribe(t => println("###: " + t))
to make it work with jdk 1.6
zsxwing commented
I know nothing about Scala Swing. But for Java Swing, you should touch the UI stuff only in the UI event queue because most of UI components are not thread safe. See https://docs.oracle.com/javase/tutorial/uiswing/concurrency/dispatch.html
freewind commented
OK, and thanks, this can be a reminder for other guys who wants to use rxscala with scala-swing