My personal laptop has recently had to be retired. A combination of age, damage to the outer case and over heating problems has made it difficult to use for anything beyond web browsing without it over heating and shutting down. The case is battered to the point of a new chip coming loose every few weeks. The laptop was getting old so it was about time to replace it.
My new laptop has a touchscreen. So I decided to take it to work with me and look into the possibilities of touchscreen with our library and Swing in general. Now I know Swing is on its way out but that doesn’t mean we shouldn’t squeeze as much out of it as possible before then.
So looking at the way the touchscreen works it appears as if the touchscreen is actually just a fancy mouse, when you include multi-touch support it is a very fancy mouse. Now I believe that multi-touch may be a bit out of the reach of Swing. I could be wrong here, a quick search has shown that it might be possible but for now it is beyond my knowledge.
So, single-touch touchscreen functionality is basically a mouse. When using the touchscreen, Swing treats the events of the touch screen as various mouse events. A tap is treated as a mouse pressed action, double tap as a mouse clicked. It is easy enough to guess what the different input methods for the touchscreen translate to.
This is only a very basic review of using touchscreen monitors with Swing. In future posts I will be describing in more detail how to achieve different effects such as using flick to scroll pages based on speed and direction of the flick, gestures and patterns to perform given tasks and anything else I can find of interest.
IDRsolutions develop a Java PDF library, a PDF forms to HTML5 converter, a PDF to HTML5 or SVG converter and a Java Image Library that doubles as an ImageIO replacement. On the blog our team post about anything interesting they learn about.