开发者

Wrapping text in a text box

开发者 https://www.devze.com 2023-02-18 04:30 出处:网络
I have the following line of code that consists of a text box: NameTextCustomers = new JTextField(); NameTextCustomers.setBounds(10, 10, 350, 150);

I have the following line of code that consists of a text box:

    NameTextCustomers = new JTextField();
NameTextCustomers.setBounds(10, 10, 350, 150);
    Customers.add( NameTextCustomers);

I would开发者_如何学JAVA like to align the text so it starts at the top left and it wraps within the box. Meaning the words don't disappear off screen, they continue to the next line. I'm not sure what or where to put additional code to accomplish this.

Thanks


You'll probably want to use a JTextArea rather than a JTextField. JTextFields are really meant for a single line of text.

0

精彩评论

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

关注公众号