rana_b 2003/01/20 07:14:08 Modified: ftpserver/src/java/org/apache/avalon/ftpserver/gui GuiUtils.java Log: Added getTopFrame method Revision Changes Path 1.8 +11 -1 jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/gui/GuiUtils.java Index: GuiUtils.java =================================================================== RCS file: /home/cvs/jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/gui/GuiUtils.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- GuiUtils.java 10 Mar 2002 06:10:36 -0000 1.7 +++ GuiUtils.java 20 Jan 2003 15:14:07 -0000 1.8 @@ -91,6 +91,16 @@ return splashWin; } + /** + * Get top frame. May return null, if parent frame not found. + */ + public static Component getFrame(Component comp) { + Component frameComp = comp; + while( (frameComp != null) && !(frameComp instanceof java.awt.Frame) ) { + frameComp = frameComp.getParent(); + } + return frameComp; + } /** @@ -216,4 +226,4 @@ parent.repaint(); } -} \ No newline at end of file +}
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>