开发者

Text in a JTextField not wrapping around

开发者 https://www.devze.com 2023-04-12 16:19 出处:网络
My original plan today was to learn how to use the JProgressBar, but now I am stuck with a new problem which I was not expecting. So here is how my JFrame looks like right now.

My original plan today was to learn how to use the JProgressBar, but now I am stuck with a new problem which I was not expecting. So here is how my JFrame looks like right now.

Text in a JTextField not wrapping around

The problem is that the JTextField right under the JTextArea is not wrapping around. It is going beyond the size of the JFrame. I want it to resize relative to the JFrame. How can i do that? I have tried the JLabel but it does the same thing, only i开发者_如何学运维t adds ellipses in the end where the text overflows.


Try using a JTextArea if you intend for the field to expand vertically to accommodate the text.

JTextFields are intended for a single line of text.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号