JTextField 在不扩展窗口的情况下被截断
我有一个 Java Swing 应用程序,它有一个 JTextField
位于其中。我想为该字段指定一个最小宽度,以便无论如何它都会扩展。我什至尝试在字段内添加一些文本来启动它,但无济于事。
编辑:布局是该特定区域的 GridBagLayout。
I have a Java Swing application which has a JTextField
inside it. I want to assign a minimum width to the field so it is expanded no matter what. I even tried starting it with some text inside the field to no avail.
Edit: The Layout is a GridBagLayout for that particular area.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这取决于您使用的布局,但尝试
或初始化文本字段
It depends on what layout you are using but try
or initialize the text field with