Closed freewind closed 9 years ago
Looks this is not an RxScala issue.
Just found it works well with jdk1.7 & 1.8
, but failed with jdk 1.6
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
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
OK, and thanks, this can be a reminder for other guys who wants to use rxscala with scala-swing
Described here, thanks: http://stackoverflow.com/questions/33627505/reactivex-in-scala-swing-doesnt-work