SwingPlus tries to fill in the holes left behind by Scala-Swing. From missing
.height methods to missing components such as
Spinner to additional components such
GroupPanel. It also fixes the incompatibility of certain components with Java 7.
SwingPlus is (C)opyright 2013–2014 Hanns Holger Rutz and released under the GNU Lesser General Public License v2.1+ and comes with absolutely no warranties. To contact the author, send an email to
contact at sciss.de.
It contains some classes (e.g.
ComboBox) derived from the original Scala-Swing package, (C)opyright 2007-2013, LAMP/EPFL, which was released under a BSD style license.
requirements / installation
This project currently compiles against Scala 2.11, 2.10 using sbt 0.13.
To use the library in your project:
"de.sciss" %% "swingplus" % v
The current version
To compile the project, you must currently use JDK 7. This is because some Java Swing classes were retrofitted with generics, something that the Scala compiler chokes on when using JDK 6. Note however, that SwingPlus can be used both under JDK 6 and JDK7 (that is the entire point of providing our own versions of
Please see the file CONTRIBUTING.md
All classes and methods reside in package
additional standard components
GroupPanelis a panel with a group-layout. I departed from Andreas Flierl's approach and simplified or changed the API, reducing the amount of complex conversions. I think I have arrived at a reasonable simple to use component.
OverlayPanelis a panel with an overlay-layout.
ToolBarwraps the corresponding javax component.
Separatorwraps the corresponding javax component.
Spinnerwraps the corresponding javax component. Currently it still relies on javax's
SpinnerModel. A future version might seem a more Scala'ish wrapper for the model, too.
PopupMenuwraps the corresponding javax component. Note that Scala 2.11 does have a popup menu now, but you can use this one for compatibility between Scala 2.10 and 2.11.
ComboBoxdoes away with the Scala-Swing version that has problems compiling under JDK 7 due to the retrofitting of generics in Swing. It achieves this by hiding the peer type, at the same time adding a few missing methods and therefore making it usually unnecessary to gain access to the
JComboBoxpeer type. I have also added a proper
ListViewhas the same problem as
ComboBoxin standard Scala-Swing. The version provided here is also usable in project that want to allows compilation both in JDK 6 and 7. It also has a proper
Modelwrapper. Note that it fires events in
ScrollBarfixes the Scala-Swing version by dispatching
DropModeis a type-safe enumeration wrapping the javax constants. It is currently used for the
additional utility components
DoClickActionis an action that causes a visual button press
Labeledis a useful class for presenting fully typed objects in a combo-box, providing an alternative string representation
PaddedIconadds an extra margin to an existing
SpinningProgressBaris a small indefinite progress bar that can be hidden. Some look-and-feels (e.g. Aqua) support rendering a spinning icon instead of a bar.
SpinnerComboBoxis a combo-box with a
Spinnerfor editing numbers.
They are imported through
heightare provided, so one does not have to create a
baselineis provided. This is currently using the
Inttype of javax. A future version might use a type-safe enumeration instead. Method
clientPropscreates a lightweight wrapper for the component's client properties, providing a subset of methods familiar from Scala's
defaultCloseOperationis provided with the type-safe enumeration type
Action.wrapallows one to wrap a javax
Actionas a Scala-Swing
Please also check out the ScalaSwingContrib project which has similar goals.
Also check out the TreeTable project which provides a very powerful component, combining tree and table. Ideally this will also go into the mix, but API needs to be properly developed and should negotiate common interface with Ken Scambler's tree implementation.
Finally, there is Desktop, which aims rather at an application framework based on Swing.