'How do I change the layout of text areas in java swing

I started making this web page for a project and this is what it looks like so far:

https://i.stack.imgur.com/ZzsKS.png

but I want to place the text areas as one on top of the other rather than side to side

How i want it to look:

https://i.stack.imgur.com/vHrgS.png

can someone help me out please

https://i.stack.imgur.com/ZzsKS.png



Solution 1:[1]

Set the layout of your panel (or whatever component that contains your textareas) to GridLayout with 4 rows and 1 column. This will put all 4 components (2 Labels and 2 TextAreas one after another in a column)

https://docs.oracle.com/javase/tutorial/uiswing/layout/grid.html

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 vivek