Java examples for Swing:JFrame
Finds frames with an icon
//package com.java2s; import java.awt.Frame; import java.util.ArrayList; import java.util.List; public class Main { /**/* w ww . ja v a 2 s . com*/ * Finds frames with an icon: Frames of {@code Frame#getFrames()} where * {@code Frame#getIconImage()} returns not null. * * @return frames with an icon or an empty list */ public static List<Frame> findFramesWithIcons() { List<Frame> frames = new ArrayList<>(); Frame[] allFrames = Frame.getFrames(); for (Frame frame : allFrames) { if (frame.getIconImage() != null) { frames.add(frame); } } return frames; } }