Share via


Component.setBounds

Class Overview | Class Members | This Package | All Packages

Syntax 1

public void setBounds( int x**, int** y**, int** width**, int** height )

Parameters
  • x
    The new x-coordinate of this component.
  • y
    The new y-coordinate of this component.
  • width
    The new width of this component.
  • height
    The new height of this component.
Description

Moves and resizes this component. The new location of the top-left corner is specified by x and y, and the new size is specified by width and height.

See Also

getBounds, setLocation, setLocation, setSize, setSize

Syntax 2

public void setBounds( Rectangle r )

Parameters
  • r
    The new bounding rectangle for this component.
Description

Moves and resizes this component to conform to the new bounding rectangle r. This component's new position is specified by r.x and r.y, and its new size is specified by r.width and r.height.

See Also

getBounds, setLocation, setLocation, setSize, setSize