20

I'm a java developer and I love this techonology. However, in my advisor next research we are going to use extensively touch-screen devices on Windows. This is a problem for me, because I'm used to programming on Linux and with Java.

The question is, is there an API for Java for touchscreen devices? If yes, is this API good/mature? The need for a Java API is not only because I love Java but because I don't know how to program specifically to Windows, that is, I've never used Win32 or .NET. If there isn't is there something available for Mono? I hate to exclude platforms.

Marcos Roriz Junior
  • 4,076
  • 11
  • 51
  • 76
  • 2
    If you hate to exclude platforms, I would recommend using the API that is native for that platform. Win32 and .NET are different, but why limit yourself to a single language? In ten years (for example) you're really going to wish you knew another development system besides java. – KevinDTimm Dec 16 '10 at 03:17
  • 1
    @KevinDTimm it's be cause I'm used to Java. I'm thinking on learning C# to do this, as it seems the API is really easy. I think I'll follow your and my professor advise, the right tool for the right job. It seems that Java is not the right tool, and I should probably learn new tools/languages. :) – Marcos Roriz Junior Dec 16 '10 at 03:24
  • 1
    Touchscreen events are converted to regular mouse events, unless you need more sophisticated touch events (e.g. pressure, touch size, etc) you should only need to use regular awt's MouseListener – Lie Ryan Jan 04 '11 at 02:52
  • 1
    @Lie: Or multitouch, or gestures, or just knowing you're on a tablet and won't be receiving mouse-move events with no buttons pressed. – Ben Voigt Jan 04 '11 at 03:42

2 Answers2

15

Gosh, if you really want to offer a bounty on a question that can be answered in 6 seconds using google:

Community
  • 1
  • 1
Ben Voigt
  • 277,958
  • 43
  • 419
  • 720
5

This is an old question but i find it may still be useful. Java Swing does not have native support for touch-events. However, Java FX does. Java FX is already integrated in Java SE 7 and 8 and could be installed on Java SE 6. See this article from Oracle

Fermat's Little Student
  • 5,549
  • 7
  • 49
  • 70