0

I have to make a system to control access to a group of computers. I need the main screen to be displayed in full screen and cannot be closed, minimized or changed. I have already managed to do the first two. But I don't know how to block the Windows key and the combination alt + tab.

This is the way I am doing it. I don't know if there is a better way.

@Override
public void start(Stage primaryStage) {
    try {
        FXMLLoader loader = new FXMLLoader();
        loader.setLocation(Main.class.getResource("/vista/PantallaBloqueo.fxml"));
        Pane ventana = (Pane) loader.load();
        
        Scene escena = new Scene(ventana);
        
        primaryStage.setScene(escena);
        primaryStage.setFullScreen(true);
        primaryStage.setOnCloseRequest(e -> e.consume());
        primaryStage.setFullScreenExitKeyCombination(KeyCombination.NO_MATCH);
        primaryStage.addEventFilter(KeyEvent.KEY_PRESSED, ke -> {
            if (ke.getCode() == KeyCode.ALT && ke.isAltDown())
                ke.consume();
        });

        primaryStage.show();
    } catch (IOException error) {
        System.out.println(error);
    }
}

What I need is for this window to override the entire Windows system until users log in.

Thanks :)

  • I'm not aware of a suitable abstraction in the JavaFX API, but you may be able to [_Turn Java App into Windows Screensaver_](https://stackoverflow.com/q/2135982/230513). – trashgod Aug 25 '23 at 17:16
  • 1
    I doubt there's a way to _replace_ the Windows lock screen. To allow that would seem to invite security holes. There's "kiosk mode" (or whatever they call it), but that doesn't exactly sound like what you want. Why can't you just use the standard Windows admin/management tools to control access to the computers? – Slaw Aug 25 '23 at 19:52

0 Answers0