如何在 JavaSwing 的框布局中设置文本字段的首选大小

问题描述 投票:0回答:0

the code

我使用 JFrames 在 netbeans 中创建了一个 GUI。我用盒子布局来设计,但我无法根据我的喜好设置名为“loca”的Jtextfield的大小。

the output

这是我编写的代码得到的输出。

但是如您所见,Jtextfield 确实很大。我希望它根据我的尺寸和尺寸调整大小。

java swing jframe jtextfield boxlayout
© www.soinside.com 2019 - 2024. All rights reserved.