Determines which cell in the layout grid contains the point specified by
(x, y)
. Each cell is identified by its column index (ranging from 0 to the number of columns minus 1) and its row index (ranging from 0 to the number of rows minus 1).
If the (x, y)
point lies outside the grid, the following rules are used. The column index is returned as zero if x
lies to the left of the layout for a left-to-right container or to the right of the layout for a right-to-left container. The column index is returned as the number of columns if x
lies to the right of the layout in a left-to-right container or to the left in a right-to-left container. The row index is returned as zero if y
lies above the layout, and as the number of rows if y
lies below the layout. The orientation of a container is determined by its ComponentOrientation
property.
@param x the x coordinate of a point
@param y the y coordinate of a point
@return an ordered pair of indexes that indicate which cellin the layout grid contains the point (x, y).
@see java.awt.ComponentOrientation
@since JDK1.1