- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
How execution of script within a new thread can avoid some Swing problems that appeared in ScalaLab based on Scala 2.9 ?
Thu, 2011-06-30, 11:22
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