Example usage for javafx.stage Stage getIcons

List of usage examples for javafx.stage Stage getIcons

Introduction

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

Prototype

public final ObservableList<Image> getIcons() 

Source Link

Document

Gets the icon images to be used in the window decorations and when minimized.

Usage

From source file:com.kotcrab.vis.editor.CrashReporter.java

@Override
public void start(Stage stage) throws Exception {
    Parent root = FXMLLoader.load(getClass().getResource("crash-reporter-layout.fxml"));

    Scene scene = new Scene(root);

    stage.setTitle("VisEditor Crash Reporter");
    stage.getIcons().add(new Image(CrashReporter.class.getResourceAsStream("icon.png")));
    stage.setScene(scene);/*from w w  w  . j  a  v  a  2 s  .  c om*/
    stage.setResizable(false);
    stage.sizeToScene();
    stage.show();
}

From source file:com.toyota.carservice.SplashScreen.java

@Override
public void start(Stage stage) throws Exception {
    Parent root = FXMLLoader.load(getClass().getResource("/com/toyota/carservice/view/formSplash.fxml"));
    Scene scene = new Scene(root);
    stage.setTitle("Connection to database...");
    ApplicationContext appContex = config.getInstance().getApplicationContext();
    Resource resource = appContex.getResource("classpath:com/toyota/carservice/img/kallatoyota.png");
    stage.getIcons().add(new Image(resource.getURI().toString()));
    stage.setScene(scene);/*from   www.ja  v  a2s. c  o  m*/
    stage.initStyle(StageStyle.UNDECORATED);
    stage.show();
}

From source file:cz.lbenda.rcp.DialogHelper.java

public void openWindowInCenterOfStage(Stage parentStage, Pane pane, String title) {
    Stage stage = new Stage();
    stage.setTitle(title);/* w w  w  . ja  v a 2  s . c  o m*/
    stage.setScene(new Scene(pane, pane.getPrefWidth(), pane.getPrefHeight()));
    stage.getIcons().addAll(parentStage.getIcons());
    stage.show();
    stage.setX(parentStage.getX() + (parentStage.getWidth() - stage.getWidth()) / 2);
    stage.setY(parentStage.getY() + (parentStage.getHeight() - stage.getHeight()) / 2);
}

From source file:com.rcs.shoe.shop.fx.controller.ui.NewProductController.java

private void showProductCodePopup() {
    Alert alert = new Alert(AlertType.INFORMATION);
    alert.setTitle("ifra proizvoda!");
    alert.setHeaderText("ifra ne moe biti prazna!");
    alert.setContentText("");

    ButtonType okButton = new ButtonType("Nastavi", ButtonData.OK_DONE);

    alert.getButtonTypes().setAll(okButton);

    Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
    stage.getIcons().add(uIConfig.getIcon());

    alert.showAndWait();//from   ww  w. j a  va 2 s.  c  o  m
}

From source file:com.rcs.shoe.shop.fx.controller.ui.NewProductController.java

private void openProductFoundDialog() {
    Alert alert = new Alert(AlertType.CONFIRMATION);
    alert.setTitle("Ovaj reni broj je zauzet!");
    alert.setHeaderText("Redni broj: " + produstNumber.textProperty().getValue() + " je zauzet!");
    alert.setContentText("Da li elite da izmenite stanje za ovaj proizvod?");

    ButtonType okButton = new ButtonType("Da", ButtonData.OK_DONE);
    ButtonType cancelButton = new ButtonType("Ne", ButtonData.CANCEL_CLOSE);

    alert.getButtonTypes().setAll(okButton, cancelButton);

    Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
    stage.getIcons().add(uIConfig.getIcon());

    Optional<ButtonType> result = alert.showAndWait();
    if (result.get().getButtonData() == ButtonData.OK_DONE) {
        openEditForm();/*from  w  w w  .jav a2 s  . c  o  m*/
    }
}

From source file:de.thomasbolz.renamer.Main.java

@Override
public void start(Stage primaryStage) throws Exception {
    Parent root = FXMLLoader.load(getClass().getResource("/de/thomasbolz/renamer/renamer.fxml"));
    final Properties properties = readPropertiesFromClasspath("renamer.properties");
    primaryStage.setTitle(properties.getProperty("app.name", "app.name") + " v"
            + properties.getProperty("app.version", "app.version"));
    primaryStage.setScene(new Scene(root, 1000, 800));
    primaryStage.getIcons().add(new Image("icon-16.png"));
    primaryStage.getIcons().add(new Image("icon-32.png"));
    primaryStage.getIcons().add(new Image("icon-64.png"));
    primaryStage.getIcons().add(new Image("icon-128.png"));
    primaryStage.getIcons().add(new Image("icon-256.png"));
    primaryStage.show();//from   w  w w .ja  v a 2  s .c  o  m
}

From source file:at.ac.tuwien.qse.sepm.gui.App.java

@Override
public void start(Stage stage) throws Exception {
    logger.info("Application started.");

    FXMLLoader loader = new FXMLLoader();
    loader.setControllerFactory(context::getBean);

    // set base location so that resources can be loaded using relative paths
    loader.setLocation(getClass().getClassLoader().getResource("view"));

    Parent root = loader.load(getClass().getClassLoader().getResourceAsStream("view/Main.fxml"));

    stage.setScene(new Scene(root));

    stage.setTitle("travelimg");
    stage.getIcons().add(getApplicationIcon());
    stage.show();/* w ww .  j  a  v  a2 s.  c  o m*/

    PhotoService photoService = (PhotoService) context.getBean("photoService");
    photoService.initializeRepository();
}

From source file:Jigs_Desktop_Client.GUI.FXMLDocumentController.java

public void updateMessagesList(String message) {
    message = WordUtils.wrap(message, 42);
    messages.add(message);/*from w  w  w.ja  v  a 2s . co m*/
    if (!message.contains("No")) {
        this.alert("resources/app_new_message.mp3");
        Stage stage = (Stage) this.main_panel.getScene().getWindow();
        if (stage.isIconified()) {
            try {
                stage.getIcons().setAll(new Image(
                        getClass().getResource("resources/Chat_notification.png").toURI().toString()));
            } catch (URISyntaxException ex) {
                Logger.getLogger(FXMLDocumentController.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }
    messages_list.setItems(messages);
}

From source file:com.properned.application.SystemController.java

@FXML
public void openHelpDialog() {
    logger.info("Open the help dialog");
    FXMLLoader loader = new FXMLLoader();
    loader.setLocation(getClass().getResource("/com/properned/gui/helpFrame.fxml"));
    loader.setResources(MessageReader.getInstance().getBundle());

    try {/*from   w  w  w .  j a v a2  s  . c  o  m*/
        loader.load();
        Parent root = loader.getRoot();
        Stage modalDialog = new Stage();
        modalDialog.setTitle(MessageReader.getInstance().getMessage("menu.help.help"));
        modalDialog.setResizable(true);
        modalDialog.getIcons().add(new Image("/com/properned/style/icon/icon_16.png"));

        Scene scene = new Scene(root);
        scene.getStylesheets().add("/com/properned/style/application.css");
        modalDialog.setScene(scene);
        modalDialog.show();
    } catch (IOException e) {
        Properned.getInstance().showError(MessageReader.getInstance().getMessage("error.openFrame"), e);
    }
}

From source file:com.toyota.carservice.config.config2.java

public Object newStage3(Stage stage, Label lb, String load, String judul, boolean resize, StageStyle style,
        boolean maximized) {
    try {/*from  w w  w .  jav a  2s . c o m*/
        Stage st = new Stage();
        stage = (Stage) lb.getScene().getWindow();
        FXMLLoader root = new FXMLLoader(getClass().getResource(load));

        Scene scene = new Scene(root.load());
        st.initStyle(style);
        st.setResizable(resize);
        st.setMaximized(maximized);
        st.setTitle(judul);
        st.setScene(scene);
        ApplicationContext appContex = config.getInstance().getApplicationContext();
        Resource resource = appContex.getResource("classpath:com/toyota/carservice/img/kallatoyota.png");
        st.getIcons().add(new Image(resource.getURI().toString()));
        st.show();
        return root.getController();
    } catch (Exception e) {
        e.printStackTrace();
    }
    return null;
}