Saturday, March 01, 2003

CodeBit; How to Find the Parent Frame of a Component Using Java

Frame getParentFrame() {
  Component p = this;

  while ( (p = p.getParent()) != null && !(p instanceof Frame) )
    ;
  return( (Frame)p );
}
Post a Comment