简体   繁体   中英

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM