PPT Slide
- One could specify the location of a Component by specific x and y coordinates. The Component class contains the method setLocation(int width, int height):
-
Button myButton = new Button (“Click”);
add(myButton); // adds to whatever ‘this’ container is
myButton.setLocation(25, 75);
Layout Managers -- Motivation