You are viewing the RapidMiner Developers documentation for version 8.2 - Check here for latest version

Resources for Learning Java Swing

There are many ways to get a grip on how to create GUI elements with Java Swing. Java Swing provides lightweight components in the package javax.swing which is built on top of the AWT API (package java.awt).

Online resources

Javadocs

The Javadocs for Swing are available here.

Tutorials

A good starting point is the official documentation on the Oracle website, also called The Swing Tutorial.

Many other websites provide Java Swing tutorials. See for example:

Very often there is more than one example for each class (e.g. Basic example, Example with EventListener and More complex example).

Online courses

  • Some free videos are available on streaming platforms, e.g. YouTube.
  • The self study course Java Swing Programming: From Beginner to Expert by John Purcell can be purchased from various resources (Udemy, Cave of Programming, ... )
  • The course Java Swing GUI Widget Toolkit is available on EDUCBA.

Offline resources

Books (examples only covering Java Swing)

  • Java Swing (M. Loy, R. Eckstein, D. Wood, J. Elliott, B. Cole) ISBN 978-0596004088
  • Learn Java GUI Applications (P. Conrod, L. Tylee) ISBN 978-1937161552
  • Swing: A Beginner's Guide (H. Schildt) ISBN 978-0072263145

Java Swing EventListeners

This Oracle Website provides information about all EventListeners which are supported by Swing components. Because all Swing components are derived from the AWT Component class, you can register the following listeners on any Swing component:

  • component listener
  • focus listener
  • key listener
  • mouse listener
  • mouse-motion listener
  • mouse-wheel listener
  • Hierarchy Listener
  • Hierarchy Bounds Listener

Java Swing LayoutManagers

To make basic visualizations, RapidMiner uses the Java Swing LayoutManagers BorderLayout, BoxLayout, CardLayout and FlowLayout. Since these LayoutManagers are quite limited, RapidMiner also uses the GridBagLayout.

The GridBagLayout enables you to explore the full capabilities of Java Swing, but it requires some effort to learn how to use it.

RapidMiner specific classes

RapidMiner has extended some Java Swing classes to increase their usability.

Extended Swing Class Location Added functionality
ExtendedJTable com.rapidminer.gui.tools This class extends a JTable in a way that editing is handled like it is expected, i.e. editing is properly stopped during focus losts, resizing, or column movement. The current value is then set to the model. The only way to abort the value change is by pressing the Escape key
ExtendedJScrollPane com.rapidminer.gui.tools This extended version of the JScrollPane uses increased numbers of unit increments for both scroll bars making it more useful for mouse wheels
SwingTools com.rapidminer.gui.tools This helper class provides some static methods and properties which might be useful for several GUI classes including error messages, text panels, ...
DataViewer com.rapidminer.gui.viewer Can be used to display (parts of) the data by means of a JTable. Used to display ExampleSet results with a DataViewerTable