Here you can find the source of setDefaultImageIcons(Window window)
public static void setDefaultImageIcons(Window window)
//package com.java2s; /******************************************************************************* * Copyright (c) 2010 BSI Business Systems Integration AG. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors:// ww w . ja v a 2s.c o m * BSI Business Systems Integration AG - initial API and implementation ******************************************************************************/ import java.awt.Image; import java.awt.Window; import java.util.ArrayList; import java.util.List; import javax.swing.Icon; import javax.swing.ImageIcon; import javax.swing.UIManager; public class Main { public static void setDefaultImageIcons(Window window) { Icon icon = UIManager.getIcon("Window.icon"); if (icon instanceof ImageIcon) { window.setIconImage(((ImageIcon) icon).getImage()); } Object icons = UIManager.getDefaults().get("Window.icons"); if (icons instanceof List<?>) { List<Image> iconList = new ArrayList<Image>(); for (Object ico : ((List<?>) icons)) { if (ico instanceof Image) { iconList.add((Image) ico); } } window.setIconImages(iconList); } } }