    public void getRangeExtents (int startOffset, int endOffset,
                                 org.omg.CORBA.IntHolder x,
                                 org.omg.CORBA.IntHolder y,
                                 org.omg.CORBA.IntHolder width,
                                 org.omg.CORBA.IntHolder height,
                                 short coordType) {
        /* coordType:
           If 0, the above coordinates are reported in pixels relative
           to corner of the screen; if 1, the coordinates are reported
           relative to the corner of the containing toplevel window.
        */
        if (coordType != 0 && coordType != 1) {
            return;
        }

        if (accText instanceof AccessibleExtendedText) {
            // getTextBounds returns bounds relative to the parent container.
            AccessibleExtendedText accExtendedText = (AccessibleExtendedText)accText;
            Rectangle rect = accExtendedText.getTextBounds(startOffset, endOffset);
            if (rect == null) {
                return;
            }
            AccessibleContext accParent =
                ac.getAccessibleParent().getAccessibleContext();
            AccessibleComponent accComponent = (AccessibleComponent)accParent;
            Point parentLocation = accComponent.getLocationOnScreen();

            if (coordType == 0) {
                // getTextBounds returns a location relative to the parent
                // container. Add the location of the parent container relative
                // to the top-right corner of the screen.
                x.value = rect.x + parentLocation.x;
                y.value = rect.y + parentLocation.y;
                width.value = rect.width;
                height.value = rect.height;
            } else {
                // Same as for (coordType == 0) above, but subtract the location
                // of the top-level container.
                Point topLocation = getToplevelLocationOnScreen();
                x.value = rect.x + parentLocation.x - topLocation.x;
                y.value = rect.y + parentLocation.y - topLocation.y;
                width.value = rect.width;
                height.value = rect.height;
            }
        }
    }

