public static void addListenerToAllComponents( String listenerName, EventListener listener, Component c ) {
        if( c == null )
            return;
        try {
            Class[] classes = listener.getClass().getInterfaces();
            if( classes.length > 0 ) {
                Method addListenerMethod = c.getClass().getMethod( "add" + listenerName, new Class[] { classes[ 0 ] } );
                addListenerMethod.invoke( c, new Object[] { listener } );
            }
        }
        catch( Exception ignore ) {
            ignore.printStackTrace();
        }
        if( c instanceof Container ) {
            Component[] components = ((Container)c).getComponents();
            for( int i = 0; i < components.length; i++ )
                addListenerToAllComponents( listenerName, listener, components[ i ] );    
        }
    }