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

JWindow(Window [, *]) does not comply to CCC

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.4.0
    • client-libs
    • beta
    • sparc
    • solaris_2.6



      Name: sdR10048 Date: 11/09/2000


      Two constructors
        javax.swing.JWindow(Window owner) and
        javax.swing.JWindow(Window owner, GraphicsConficuration gc)
      have headless behaviour different from CCC #4281163.
      In CCC both constructors should throw IllegalArgumentException (in
      headless implementation).
      But according to JDK1.4 javadoc 1st constructor throws
      HeadlessException, second one - IllegalArgumentException (and at the
      same time "throws HeadlessException" is noted):

      public JWindow(Window owner,
                     GraphicsConfiguration gc)
              throws HeadlessException
                     ^ ^

      Here is spec from CCC #4281163,
      http://javaweb.eng/~martak/headless/javax_swing_JWindow.html:

          /**
           * Creates a window with the owner and the specified
           * <code>GraphicsConfiguration</code> of a screen device.
           * @param owner the window to act as owner
           * @exception IllegalArgumentException if owner is <code>null</code>.
           * This exception is always thrown when
           * GraphicsEnvironment.isHeadless() returns true.
           *
           * @see java.awt.GraphicsEnvironment#isHeadless
           * @since 1.3
           */
          public JWindow(Window owner);

          /**
           * Creates a window with the owner and the specified
           * <code>GraphicsConfiguration</code> of a screen device.
           * @param owner the window to act as owner
           * @param gc the <code>GraphicsConfiguration</code> that is used
           * to construct the new <code>Window</code>;
           * if <code>gc</code> is <code>null</code>, the system
           * default <code>GraphicsConfiguration</code> is assumed
           * @exception IllegalArgumentException if owner is <code>null</code>
           * @exception IllegalArgumentException if <code>gc</code> is not from
           * a screen device. This exception is always thrown when
           * GraphicsEnvironment.isHeadless() returns true.
           *
           * @see java.awt.GraphicsEnvironment#isHeadless
           * @since 1.3
           */
          public JWindow(Window owner, GraphicsConfiguration gc);



      JDK1.4 javadoc says:

      public JWindow(Window owner)
              throws HeadlessException

           Creates a window with the specified owner window. If owner is null, the
           shared owner will be used and this window will not be focusable.
           Parameters:
                owner - the window from which the window is displayed
           Throws:
                HeadlessException - if GraphicsEnvironment.isHeadless() returns
                true.
           See Also:
                GraphicsEnvironment.isHeadless(), isFocusableWindow()



      public JWindow(Window owner,
                     GraphicsConfiguration gc)
              throws HeadlessException

           Creates a window with the specified owner window and
           GraphicsConfiguration of a screen device. If owner is null, the shared
           owner will be used and this window will not be focusable.
           Parameters:
                owner - the window from which the window is displayed
                gc - the GraphicsConfiguration that is used to construct the new
                window with; if gc is null, the system default GraphicsConfiguration
                is assumed
           Throws:
                IllegalArgumentException - if gc is not from a screen device. This
                exception is always thrown when GraphicsEnvironment.isHeadless()
                returns true
           Since:
                1.3
           See Also:
                GraphicsEnvironment.isHeadless(), isFocusableWindow()

      --------------------------------------------------
      Note: http://javaweb.eng/~martak/headless/javax_swing_JWindow.html
      declares two different exceptions (HeadlessException &
      IllegalArgumentException) for constructors of one class. Some sort of
      inconsistency.

      ======================================================================

            mmartaksunw Michael Martak (Inactive)
            dsvsunw Dsv Dsv (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: