If you donβt need multi-touch, the usual mouse drivers for use with most touch screen controllers will simply screen the touch screen with a normal mouse when a mouse click is emulated with a finger touching the screen.
As for the virtual keyboard, there are starches on Windows and MacOSX, but it's probably best to create one in an application if you can.
If you require multiple taps or problems with specific touch screen controllers, there are several options.
Your best bet on a swing, at least on windows, seems to be this project: http://www.michaelmcguffin.com/code/JWinPointer/
JavaFX seems to support touch, Intel has a tutorial: https://software.intel.com/en-us/articles/using-javafx-to-implement-multi-touch-with-java-on-windows-8- desktop . You may be able to get this to work with the swing, as there are methods for placing Swing in JavaFX and JavaFX in Swing, you can look for other answers to do the interaction between them.
There was a MT4J project, but it seems non-existent. It doesn't seem to work with Swing or JavaFX.
source share