Marc
Marc

Reputation: 69

Touch on JavaFX (Java 1.0.8-b123, VM 25.0-b70) on ARM

I programmed an application in Oracle’s NetBeans for deployment on a Raspberry Pi. The program itself works fine with the Runtime as specified in the title. To be exact, I have the jdk-8-oracle-arm-vfp-hflt.

However, when I touch the screen, the following message is given in console:

Jul 29, 2015 10:11:56 PM com.sun.glass.ui.lens.LensApplication nativeEventLoop
SEVERE: 4998 udevInput.c:1596 lens_input_pointerEvents_handleSync: malformed multi touch event - ignoring

I’ve already read, that there was a problem with the Lens framework and one would rather use Monocle, but I can’t figure out, how to include Monocle and drop Lens in NetBeans. (I am quite new to Java.)

Do you have an idea to solve this problem? I do want to use multi-touch later, if possible.

Upvotes: 4

Views: 649

Answers (2)

Sauer
Sauer

Reputation: 1479

I finally got it working!!! Unfortunately I cannot collect my own Bounty :-) The solution for this problem in my environment was:

Simply start the application with sudo:

sudo java -jar myApp.jar

The device driver of my touchscreen seems to need access to certain etc files, that are only accessible by root or with the sudo command. Give it a try!

Upvotes: 2

Sauer
Sauer

Reputation: 1479

I have the exact same problem on my RPI2 with a Hanns-G Touchscreen, which is working fine in X, but not in the JavaFX application.

As you said, I tried to use monocle instead of lens. This itself is quite challanging. There are no ready-made and complete Monocle-Jars out in the internet. The only one I find was a "headless" version, which kind of works on my PI:

http://mvnrepository.com/artifact/org.jfxtras/openjfx-monocle/1.8.0_20

While running my JavaFX app with this monocle like this:

java -Dglass.platform=Monocle -Dmonocle.platform=Headless -Dprism.order=sw -jar myJar.jar

I starts and doesnt create those malformed multitouch events anymore. Drawback is: The GUI doesnt show up, because it is "headless". Not so funny...

Monocle also works with a none-headless mode (with a GUI starting up). But it seems, as if you have to build it on your own, as described here:

https://wiki.openjdk.java.net/display/OpenJFX/Monocle

Here my luck stopped. My linux skill is too low, to build it on my own. I started a bounty, so hopefully a skilled person will help us... Good luck! I also have a friend, that has the exact same setup as I do, and he claims, that he has working touch enabled JavaFX apps running. He will show me soon. I'll keep you updated.

Upvotes: 2

Related Questions