Posts: 2
Joined: Mon Feb 13, 2017 4:39 pm

JavaFX fullscreen cursor bug

Mon Feb 13, 2017 5:21 pm

I am having an issue running fullscreen JavaFX applications where if I move the cursor "out" of the screen, into the black areas on the monitor where the cursor can't be seen, and then bring the cursor back on to the visible part of the screen, the cursor bugs out until I reboot the Pi. If the cursor is moved to the bottom portion of the screen it turns into a black line, if it is moved into the right portion of the screen it turns into a black square. Here is a video showing the bug

At first I thought maybe it was an issue with my code, but even just running a simple Hello World JavaFX application in fullscreen causes the same issue. This only happens when I run the applications on the Pi, they run fine on my desktop running Windows. I managed to stop this from occurring by enabling overscan on the Pi and basically creating black bars around the application using the overscan settings for each side of the screen, which stops the user from being able to move the cursor out of the visible area. But these settings then have to be changed for each screen I connect the Pi to, which is a disaster. Any advice would be greatly appreciated.

Here are the system specs:
Raspberry Pi 3
Raspbian Jessie 8
Java: Oracle 1.8.0_65
JavaFX Embedded from:
(I have also tried Oracle's Java 1.8.0 which still supported JavaFX for embedded, unfortunately I still run into the same issue)

Posts: 1
Joined: Wed May 03, 2017 9:33 am

Re: JavaFX fullscreen cursor bug

Wed May 03, 2017 9:52 am

Hello Mhmmx,

I ran into the same issue and spent days to find an acceptable solution.
One option is to set the framebuffer screen size in /boot/config.txt in case of 1280x800 resolution:

Code: Select all

So the cursor will remain inside the screen. But it is not the best solution...

Your second option is to use javafx with gtk2:

Code: Select all

$JAVA_HOME/bin/java -Djavafx.platform=gtk2 -jar MyJavafxApp.jar
Actually it works fine with gtk2, and I am able to control the application via vnc, which was also a requirement in my case.

Return to “Troubleshooting”