Unfortunately, this is not something you can do natively under any Java platform. Anyone who manages to get him to work using such a โtrickโ that you showed will be disappointed that he is unlikely to work on another version of Windows or even on another computer with the same version of Windows. The only time I have ever seen a Java window flash is caused by some Swing crashing while minimizing all windows on the taskbar.
How this article about how Java applications feel native is the same thing on Mac OS.
Itโs best to use the methods described in this article to create a JNI that calls the Windows API call, or obtain a license for JNIWrapper (find it) that does all this for you (the best option is if you are creating a commercial application or making it for a client who is willing to pay for such a function). It looks like you can get a 30-day trial for this.
The only thing I could offer is to create the equivalent of a bad person for a pop-up notification system. When you want to warn the user, create a frame without a frame, place it in the lower right corner of the screen, make it inactive, and show it for a short period of time.
source share