Example usage for javax.swing JDialog getComponentCount

List of usage examples for javax.swing JDialog getComponentCount

Introduction

In this page you can find the example usage for javax.swing JDialog getComponentCount.

Prototype

public int getComponentCount() 

Source Link

Document

Gets the number of components in this panel.

Usage

From source file:op.tools.SYSTools.java

/**
 * luft rekursiv durch alle Kinder eines JFrames und entfernt evtl. vorhandene Listener.
 *///from  w  ww  .  j a  v a  2s .c o m
public static void unregisterListeners(JDialog 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]);
            }
        }
    }
}