Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I use Java Swing. Here's how it stacks up against your requirements:</p> <ul> <li><p>mature and used extensively: yes, a ton.</p></li> <li><p>rich widget set and renders well: this is debatable. When you consider the ability to easily supplement Java Swing with additional libraries (eg SwingX), it at least does better than Scala Swing in this regard, though probably not as well as some other Java toolkits (though I can't speak to those).</p></li> <li><p>idiomatic Scala: not as bad as you might think. A few helper functions make it better:</p> <pre><code>implicit class And[A](a: A) { def and(f: A =&gt; Unit): A = { f(a); a } } </code></pre> <p>So that you can do</p> <pre><code>val button = (new JButton("Press me!") and (_ setForeground Color.red) and (_ setFont new Font(null, Font.PLAIN, 12))) val win = (new JFrame("Hello!") and (_ add button) and (_ pack()) and (_ setDefaultCloseOperation JFrame.EXIT_ON_CLOSE) and (_ setVisible(true))) </code></pre> <p>Now as for events and state, this is still, in my opinion, a rough edge in <em>all</em> gui frameworks -- listeners have their problems, event streams have their problems. I have had general success in augmenting Swing's events with <a href="https://github.com/nafg/reactive/tree/master/reactive-core" rel="noreferrer">reactive-core</a> and <a href="https://github.com/ellbur/redo-signals" rel="noreferrer">redo-signals</a> (my own, undocumented) in order to make it easier to organize state.</p> <p>You can improve the verbosity of defining listeners with a few more helper functions like</p> <pre><code> def actionListener(f: =&gt; Unit) = new ActionListener { def actionPerformed(e: ActionEvent) { f } } </code></pre> <p>and</p> <pre><code> def later(thing: =&gt; Unit) { SwingUtilities.invokeLater(new Runnable { def run() { thing } }) } </code></pre> <p>Personally, I wish Scala Swing had taken this route. Writing wrappers for existing Java classes is O(n) programmer time, and doesn't get you anything for the classes that the authors didn't choose to write wrappers for. Creating generic syntactic sugar will take you much farther faster.</p></li> <li><p>Got a WYSIWYG-ish but flexible GUI builder: I use IntelliJ IDEA forms, to make an abstract class, and then subclass it with a Scala class. The organizational cost is only 1 extra file, and I write no Java code.</p></li> <li><p>Standalone API documentation: Yes.</p></li> </ul>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload