public static Component getRootJDialog ( Component component ) { while ( null != component . getParent ( ) ) { component = component . getParent ( ) ; if ( component instanceof JDialog ) { break ; } } return component ; }
Gets the root JDialog from the given Component Object .