This page is no longer maintained — Please continue to the home page at www.scala-lang.org

How execution of script within a new thread can avoid some Swing problems that appeared in ScalaLab based on Scala 2.9 ?

No replies
sterg
Joined: 2009-10-06,
User offline. Last seen 2 years 39 weeks ago.

Hi all,

I had problems with some Java Swing routines
(e.g. JOptionPane.showMessageDialog(....))
in previous versions of ScalaLab (http://code.google.com/p/scalalab/)
based on the Scala 2.9 branch.
Those problems did not appeared at the Scala 2.8.1 branch.

Hopefully, these problems have bypassed by putting the code that calls
the Scala 2.9 interpreter within a new thread as:

case KeyEvent.VK_F6 =>
var r = new Runnable {
def run {
getSelectedTextOrCurrentLine.foreach( interpret( _ ))
}
}
var execThread = new Thread(r)
execThread.start

However, I cannot explain how these problems are solved. Does somebody
understand what happened?

In any case, now ScalaLab2.9 works well, reliably and very fast
and I'm happy that the problem solved, even though I do not understand
how!!

Also, the Scala InterpreterPane of Sciss works well in the 2.9 branch!

Best Regards

Stergios

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland