posted 16 years ago
A LayoutManager object helps a Container object position and size its Component objects.
Each Container has a default LayoutManager object. You can change the default LayoutManager object to a LayoutManager object of a class of your own choosing with a call to setLayout().
The method: setLayout() takes a LayoutManager object as its parameter or takes null for a manual layout in which case you have to position and size the Component objects yourself.
The statement:
f.setLayout(aLayoutManager);
sets the LayoutManager object of a JFrame, assuming that f is an instance of JFrame. The statement:
f.getContentPane().setLayout(anotherLayoutManager);
sets the LayoutManager object of the content pane of the JFrame.
Sometimes when you call a method of a Window, it is implied that you're really working on the content pane. Maybe, somebody can help me to understand this.
Kaydell