Example usage for javafx.stage Stage setFullScreenExitKeyCombination

List of usage examples for javafx.stage Stage setFullScreenExitKeyCombination

Introduction

In this page you can find the example usage for javafx.stage Stage setFullScreenExitKeyCombination.

Prototype

public final void setFullScreenExitKeyCombination(KeyCombination keyCombination) 

Source Link

Document

Specifies the KeyCombination that will allow the user to exit full screen mode.

Usage

From source file:org.openbase.display.DisplayView.java

private void init(final Stage primaryStage) throws InterruptedException, InitializationException {

    Runtime.getRuntime().addShutdownHook(new Thread() {
        @Override//from ww w .java  2  s  .  co  m
        public void run() {
            Platform.exit();
        }
    });

    try {
        // platform configuration
        Platform.setImplicitExit(false);
        primaryStage.setFullScreenExitKeyCombination(KeyCombination.NO_MATCH);
        this.primaryStage = primaryStage;

        Scene scene = new Scene(cardsPane);

        // configure hide key combination
        final KeyCombination escapeKey = new KeyCodeCombination(KeyCode.ESCAPE);
        scene.addEventHandler(KeyEvent.KEY_RELEASED, new EventHandler<KeyEvent>() {

            @Override
            public void handle(KeyEvent event) {
                if (escapeKey.match(event)) {
                    try {
                        setVisible(false);
                    } catch (CouldNotPerformException ex) {
                        ExceptionPrinter.printHistory(
                                new CouldNotPerformException("Could not execute key event!", ex), logger);
                    }
                }
            }
        });

        primaryStage.setScene(scene);

        try {
            broadcastServer = new DisplayServer(this);
            broadcastServer.init(JPService.getProperty(JPBroadcastDisplayScope.class).getValue());
            broadcastServer.activate();
        } catch (JPServiceException | CouldNotPerformException ex) {
            throw new CouldNotPerformException("Could not load display server!", ex);
        }

        try {
            displayServer = new DisplayServer(this);
            displayServer.init(JPService.getProperty(JPDisplayScope.class).getValue());
            displayServer.activate();
        } catch (JPServiceException | CouldNotPerformException ex) {
            throw new CouldNotPerformException("Could not load display server!", ex);
        }
        this.htmlLoader.init(getScreen());
    } catch (CouldNotPerformException ex) {
        throw new InitializationException(this, ex);
    }
}