GridBagLayout.location
Class Overview | Class Members |
This Package |
All Packages
public Point location( int x,
int y )
Parameters
- x
- the x coordinate of a point.
- y
- the y coordinate of a point.
Returns
an ordered pair of indexes that indicate which cell
in the layout grid contains the point
(x, y).
Description
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, and as the number of columns if x lies
to the right of the layout. 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.