Example usage for java.awt Frame setIconImages

List of usage examples for java.awt Frame setIconImages

Introduction

In this page you can find the example usage for java.awt Frame setIconImages.

Prototype

public synchronized void setIconImages(java.util.List<? extends Image> icons) 

Source Link

Document

Sets the sequence of images to be displayed as the icon for this window.

Usage

From source file:processing.app.Base.java

/**
 * Give this Frame an icon.//from  w  w  w  .ja v  a2s . c om
 */
static public void setIcon(Frame frame) {
    if (OSUtils.isMacOS()) {
        return;
    }

    List<Image> icons = Stream.of("16", "24", "32", "48", "64", "72", "96", "128", "256")
            .map(res -> "/lib/icons/" + res + "x" + res + "/apps/arduino.png")
            .map(path -> BaseNoGui.getContentFile(path).getAbsolutePath())
            .map(absPath -> Toolkit.getDefaultToolkit().createImage(absPath)).collect(Collectors.toList());
    frame.setIconImages(icons);
}