Activating Touchscreen Controls in JavaFX

I want to use the touch controls described in http://docs.oracle.com/javase/8/javafx/user-interface-tutorial/embed.htm . I am creating an application on a Windows 8 tablet, but ScrollPanes is the desktop, i.e. With scrollbars and no reaction to dragging a finger. How to tell JavaFX that I am on a mobile platform?

Change I just realized that the standard ScrollPane for the desktop responds to drag and drop, but it doesn't look like the example in the link above.

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

+1
source share
1 answer

You do not need to enable these features, but JavaFX decides on its own if they are supported. You can request features programmatically, for example. on PlatformImpl.isSupported(ConditionalFeature.INPUT_TOUCH) .

-1
source

Source: https://habr.com/ru/post/1206299/


All Articles