JavaFX. Blocking user actions

13 viewsjava 8javafxjavafx 8windows
0

I need to implement a security policy for working with documents. I encountered the following problem:
The program runs in full screen; after user authorization, the program displays a list of files that are available to the user. When opening a file using external programs (for example, a file with a .docx extension is opened using Microsoft Word), my program is minimized and the user gains access to the OS. I need my program to continue running in the background on the full screen, without allowing the user to use the operating system, and the opened file to work “on top” of my program. Used java 8

Here is file opening code:

    File file = new File(directoryPath + File.separator + fileName);
    Desktop.getDesktop().open(file);

Despite the stage setting:

    Scene scene = new Scene(content);
    primaryStage.setScene(scene);
    primaryStage.initStyle(StageStyle.UNDECORATED);
    primaryStage.setFullScreen(true);
    primaryStage.setAlwaysOnTop(true);
    primaryStage.show();

When opening a file with an external program, my program is minimized and the user has access to everything.
Maybe someone has encountered a similar problem, give me options on how this can be solved