A good answer might be:

Sure. In fact, this is often done.

GridLayout

Often the Frame of a GUI contains Panels only, which then contain the other GUI components. Different Panels might use different layout managers for their components. Nice user interfaces can be created this way with a relative minimum amount of fuss (although at the moment it might look awful to you.)

So for we have used FlowLayout as a layout manager. It is pretty good for getting components on the screen for the first few versions of a program. GridLayout is another useful layout manager. It works by dividing the Frame into a grid of as many rows and columns as you ask for. For example,

    setLayout( new GridLayout(2, 4) );       // 2 rows and 4 columns
divides the Frame into a grid of 2 rows and 4 columns, like this:
The entire useable area of the frame will be divided up into cells. Each cell will be the same size. Each cell can contain ONE component (however, that one component might be a Panel that contains several components).

QUESTION 9:

Say that you wished to use GridLayout with the Panel referenced by the variable topPanel. You want 2 rows by 3 columns. How would you do this?

Click Here after you have answered the question