I have a java application - preferably a web-application running in a Tomcat AppServer (either on a local machine or in the cloud - java hosting).
This application shall periodically show the user a message - so that some window appears on the screen (just pops up in the center of the screen like nagging advertisement), even if my app's window is minimized or inactive (lost focus). I can do such a pop-up with Java FX in the system tray - but I need a normal window (not just a small tray popup).
Here is the problem - when my app's browser window is not active (lost focus or minified) I don't know how to bring it to the front of all other open windows and applications.
I can make some Java FX Desktop module to periodically (on timer) enable my web-app browser-window to pop up. Or I can even make the whole app in Java FX (a small Java FX utility + web app would be better though) - but I don't see how I can do it in java FX either.
I can periodically start my app with Cron to achieve this, but is there any app-programming way to do it?
My own research:
I guess there is no javascript way to do it - because the browser would isolate my web-page code from the rest of the system and won't let me interfere with more than my own web-page.
I also found that I can build a Desktop app using Electron framework and it looks like (at first glance) it supports what I need. Wiki on Electron.
Also I can write a Desktop app in Java using Qt-Wrapper library for java (Qt Jambi) - it is good to know I can use Qt from Java.
If I understood right, it seems possible in iOS/Swift and maybe possible in VB
But I need a java solution anyway. Or java + some very "thin" launcher in any other language. Maybe some activation-scheduler in some scripting language?
As to JavaFX I have tried:
- stage.setMaximized(true);
- stage.setAlwaysOnTop(true);
- stage.setFocused(true);
- stage.toFront();
- nonPrimaryStage.initModality(Modality.APPLICATION_MODAL);
CRON-like: Scheduling program start-up for Windows 10:
- Z-Cron
- Win_Button + R, type
taskschd.msc
- Windows Task Scheduler schtasks
command in Console- List of many other Win10 Task_Scheduling Tools