Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6350803

JFrame and JDialog should implement a common interface

XMLWordPrintable

      A DESCRIPTION OF THE REQUEST :
      JFrame and JDialog implement many similar methods and do many of the same things. However, the closest their closest common ancestor is Window, which makes it difficult to write code that deals with either JFrames or JDialogs but not WIndows.



      JUSTIFICATION :
      It would be nice to provide an extra constructor to both JFrame and JDialog that would accept objects extending this interface.

      This would also allow a method to be added to Component that could be called getRoot() that would return either the first Frame or Dialog that this component is a child of. This is an operation I have to perform often, and it's troublesome having to handle both the Dialog and Frame cases.

            svioletsunw Scott Violet (Inactive)
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: