Activating touch-enabled controls in JavaFX

…衆ロ難τιáo~ 提交于 2019-12-20 03:06:28

问题


I want to use the touch-enabled controls described in http://docs.oracle.com/javase/8/javafx/user-interface-tutorial/embed.htm. I'm building my application on a Windows 8 tablet, but the ScrollPanes are desktop-style, i.e. with scrollbars and no reaction to finger-dragging. How do I tell JavaFX that I'm on a mobile platform?

Edit: I just realized that the standard, desktop-style ScrollPane does react to finger-dragging, but it doesn't look like the example one in the link above.

Solution: the features can be enabled by setting -Dcom.sun.javafx.isEmbedded=true and -Dcom.sun.javafx.touch=true


回答1:


There should not be a need to enable these capabilities, but JavaFX decides by itself if they are supported. You can query the capabilities programmatically, e.g. by PlatformImpl.isSupported(ConditionalFeature.INPUT_TOUCH).



来源:https://stackoverflow.com/questions/23564413/activating-touch-enabled-controls-in-javafx

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!