I’m experiencing an issue with my JavaFX application flickering on macOS. This happens even with the most basic JavaFX “Hello World” application. When I run the application and click anywhere within the window, the application momentarily flickers to the background and then comes back to the foreground. This occurs in about a tenth of a second.
Here are some details:
JDK Version: I’ve tested this on both JDK 21 and 22.
Operating System/Device: macOS on ARM architecture./ Macbook Pro M2 Pro 14″
JavaFX Version: I haven’t imported any libraries other than the defaults provided by JavaFX.
I’ve also tested this by creating a new JavaFX application without any additional libraries and the issue persists.
Is there anyone who has encountered a similar issue or can offer any insights into what might be causing this flickering problem and how to resolve it?
Steps to reproduce:
Create a new JavaFX project (or use an existing one).
Run the application.
Click anywhere within the application window.
Expected behavior:
The application should respond normally to the mouse click.
Actual behavior:
The application window briefly flickers (disappears and reappears) for a split second.