From reading parts of the Programming in Scala book, I realize that Scala can work with the Java Swing components to create GUI applications.
My question is if there are any projects or released applications (that are more than just simple examples) that use Scala and Swing?
Is this because you wish to see some actual Scala Swing code, or are you just interested as to whether Scala Swing is "production-ready"? If it is the latter, Scala Swing is pretty good: I've started using it for all GUI code. Compare:
JButton b = new JButton(); b.setText("OK"); b.setFont(f); b.setPreferredSize(new Dimension(20, 20)); b.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { //reacction here } });
with:
val b = new Button { text = "OK" font = f preferredSize = (20, 20) } listenTo(b) reactions += { case ButtonClicked(`b`) => //reaction here }
As Scala Swing is really just a lightweight layer on top of Java Swing, you can integrate any Java Swing component easily and be sure that it all works OK.
That said, the documentation as of Scala 2.7 is pretty poor. I understand that Scala Swing is being upgraded in the 2.8 release and that this will include improved documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With