如何更改 java swing 中文本区域的布局
I started making this web page for a project and this is what it looks like so far:
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:
can someone help me out please
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将面板(或包含文本区域的任何组件)的布局设置为 4 行 1 列的 GridLayout。这会将所有 4 个组件(2 个标签和 2 个文本区域依次放入一列中)
https://docs.oracle.com/javase/tutorial/uiswing/layout/grid.html
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