Wrapping text in a text box
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.
精彩评论