SwingStates

Caroline Appert and Michel Beaudouin-Lafon

Abstract

This article describes SwingStates, a library that adds state machines to the Java Swing user interface toolkit. Unlike traditional approaches, which use callbacks or listeners to define interaction, state machines provide a powerful control structure and localize all of the interaction code in one place. SwingStates takes advantage of Java's inner classes, providing programmers with a natural syntax and making it easier to follow and debug the resulting code. SwingStates tightly integrates state machines, the Java language and the Swing toolkit. It reduces the potential for an explosion of states by allowing multiple state machines to work together. We show how to use SwingStates to add new interaction techniques to existing Swing widgets, to program a powerful new Canvas widget and to control high-level dialogues.

Venue
UIST 2006
Volume
Proceedings of the 19th annual ACM symposium on User interface software and technology
DOI
10.1145/1166253.1166302
PDF
https://dl.acm.org/doi/pdf/10.1145/1166253.1166302
Anthology ID
2006.uist.40

Cite

@inproceedings{appert-beaudouinlafon-2006-swingstates,
    title = {{SwingStates}},
    author = {Caroline Appert and Michel Beaudouin-Lafon},
    booktitle = {Proceedings of the 19th annual ACM symposium on User interface software and technology},
    isbn = {1595933131},
    year = {2006},
    publisher = {Association for Computing Machinery},
    address = {New York, NY, USA},
    doi = {10.1145/1166253.1166302},
    url = {https://doi.org/10.1145/1166253.1166302},
    abstract = {This article describes SwingStates, a library that adds state machines to the Java Swing user interface toolkit. Unlike traditional approaches, which use callbacks or listeners to define interaction, state machines provide a powerful control structure and localize all of the interaction code in one place. SwingStates takes advantage of Java's inner classes, providing programmers with a natural syntax and making it easier to follow and debug the resulting code. SwingStates tightly integrates state machines, the Java language and the Swing toolkit. It reduces the potential for an explosion of states by allowing multiple state machines to work together. We show how to use SwingStates to add new interaction techniques to existing Swing widgets, to program a powerful new Canvas widget and to control high-level dialogues.}
}