Ask Question

What layout manager should you use so that every component occupies the same size in the container?

any layout

a FlowLayout

a BorderLayout

a GridLayout

+2
Answers (1)
  1. 2 June, 07:31
    0
    Answer: a GridLayout

    Explanation:

    A GridLayout enables every component occupy the same size in the container because it uses a rectangular grid to arrange the components. At least one component is displayed in the rectangular grid.

    There are three constructors of GridLayout which are useful and they are as follows:

    1. GridLayout () : This constructor creates a grid layout with one column per component in a row.

    2. GridLayout (int rows, int columns) : This constructors creates grids without any gaps and the number the of rows and columns could be specified in the form of parameters.

    3. GridLayout (int rows, int columns, int horizontalgap, int verticalgap) : It is same as the above constructor however here it takes both the horizontal and vertical gap int consideration.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “What layout manager should you use so that every component occupies the same size in the container? any layout a FlowLayout a BorderLayout ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers