In This Chapter
Discovering gestures on touch devices
Adding listeners that respond to gesture events
Creating a program that lets the user manipulate a shape with gestures
Touch devices are everywhere nowadays. Tablets and smartphones are the most common types of touch devices, but even some desktop users have installed touch-capable monitors. At one time, touch devices ran primarily non-Microsoft operating systems, such as Apple’s iOS or Google’s Android. But now, with Windows 8, many touch devices even run Windows.
Fortunately, JavaFX can run on all those platforms. In this chapter, you discover how to develop JavaFX applications that take advantage of the unique user interactions that are possible with touch devices, including basic touch and swiping and scrolling as well as multi-touch gestures such as zooming and rotating.
Before I get into the details of working with gestures and touch events, I want to point out that the support for basic touch devices for JavaFX controls is already built-in and requires no programming to enable. For example, Button controls respond to taps on a touch device just as ...