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

DOC: API doc for comp.isShowing() must be enhanced

XMLWordPrintable

    • b79
    • generic
    • generic
    • Verified

      The API Doc for Component.isShowing() says that it would return true when the component is visible and is added to a parent that is also visible and showing. This definition is not clear for some cases given below:

      1. Say a component is added to a scrollpane and not visible to the user unless he scrolls it. In such cases, isShowing() would continue to return true for the hidden component though the component is not literally showing on the screen. In this case, hidden_comp.getLocationOnScreen() will return a value that is outside the parent frame. So user can not do much with this value. Say asking a robot to click on this component would actually click somewhere outside the frame.

      2. When some component / container overlaps another component. isShowing() will return true.

      3. When a component is hidden by another frame / window.

      So the API doc must clarify the fact that comp.isShowing() returning true does not really mean that the component will be visually seen on the screen. It's upto the user to find out whether the component has been obscured by some other thing given above.

      May be it would be better to clarify the docs for getLocationOnScreen() also as the return value may not be the right location when component is not visually seen. (typically these values are used by Robot for simulating user interactions)

      This is applicable for all platforms & releases.

            dav Andrei Dmitriev (Inactive)
            pmohansunw Praveen Mohan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: