Back to Homepage

SwingStates tutorial


SwingStates is an extension of Java Swing. It allows to implement state machines and proposes a highly flexible Canvas widget. State machines can be used as an alternative (or a complement) of event listeners to handle events in a Java program. They can be used to implement new interactions for existing Swing widgets and to define new widgets starting from the SwingStates Canvas widget.

This tutorial contains applets that require at least Java 2 SDK, Standard Edition v 1.5.0 to run. Furthermore, since state machine initializations use Java reflection API, these applets require higher rights in security access than the default ones (these applets do not read or write on your file system, security access is only required for code introspection). That is why you are asked to accept or decline a certificate for the signed jar that contains these applets. If you don't trust the certificate, you will be able to read the tutorial but applets won't run.
In any case, you can download SwingStates source code on sourceforge website and run the examples on your local configuration. All applets source code is in package fr.lri.swingstates.applets.


State Machines in SwingStates

SwingStates' canvas

Customizing Swing widgets