windows 是否有用于触摸平板电脑等设备的 Java API?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4456961/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 15:48:33  来源:igfitidea点击:

Is there a Java API for touching devices such as tablets?

javawindowstouchscreen

提问by Marcos Roriz Junior

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.

我是一名 Java 开发人员,我喜欢这项技术。但是,在我的顾问接下来的研究中,我们将在Windows上广泛使用触摸屏设备。这对我来说是个问题,因为我习惯于在 Linux 和 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.

问题是,是否有用于触摸屏设备的 Java API?如果是,此 API 是否良好/成熟?需要Java API 不仅是因为我喜欢Java,还因为我不知道如何专门针对Windows 进行编程,也就是说,我从未使用过Win32 或.NET。如果没有,有什么可用于 Mono 的吗?我讨厌排除平台。

回答by Fermat's Little Student

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

这是一个老问题,但我发现它可能仍然有用。Java Swing 没有对触摸事件的本机支持。但是,Java FX 可以。Java FX 已经集成在 Java SE 7 和 8 中,可以安装在 Java SE 6 上。 请参阅 Oracle 中的这篇文章