Example usage for javax.swing JFrame getComponents

List of usage examples for javax.swing JFrame getComponents

Introduction

In this page you can find the example usage for javax.swing JFrame getComponents.

Prototype

public Component[] getComponents() 

Source Link

Document

Gets all the components in this container.

Usage

From source file:Main.java

public static void main() {

    JFrame container = new JFrame();

    Component[] components = container.getComponents();

    for (int i = 0; i < components.length; i++) {
        Rectangle bounds = components[i].getBounds();
    }/*from  w w  w . j ava2 s  .c o m*/

}

From source file:op.tools.SYSTools.java

/**
 * luft rekursiv durch alle Kinder eines JFrames und entfernt evtl. vorhandene Listener.
 *//*w w w  .  ja  v  a2 s.c  om*/
public static void unregisterListeners(JFrame container) {
    if (container == null) {
        return;
    }
    if (container.getComponentCount() > 0) {
        Component[] c = container.getComponents();
        for (int i = 0; i < c.length; i++) {
            if (c[i] instanceof JComponent) {
                unregisterListeners((JComponent) c[i]);
            }
        }
    }
}