159k views
5 votes
. In the BorderLayout class, what are NORTH, SOUTH, EAST, WEST, and CENTER?

User N Rocking
by
6.3k points

1 Answer

3 votes

Answer:

A BorderLayout corresponds to a layout type where the components are organized along geographical directions represented by NORTH, SOUTH, EAST, WEST, and CENTER.

Step-by-step explanation:

The layout class is awt determines the actual placement of components in the user interface. BorderLayout is a layout where the components are organized along geographical directions represented by NORTH, SOUTH, EAST, WEST, and CENTER. For example:

Panel p = new Panel();

p.setLayout(new BorderLayout());

p.add(new TextArea(), BorderLayout.CENTER);

p.add(new Button("Close"), BorderLayout.SOUTH);

This code segment will add a textarea at the CENTER of the interface and a button 'Close' towards the SOUTH.

User Elias Goss
by
6.4k points