Craig Hogan
Craig Hogan

Reputation: 69

settings bounds to JTextField

I have a JTextField that a User and an Admin update to try and solve a problem that a user may have. Although when I setText(conversation) to the JTextField the text starts in the middle and when it goes to the end of a line it does not go to a different line. Can I set the JTextField so that text begins at the top? and when the user/admin gets to the side of the text field it goes to another line? I have tried looking this up everywhere and can not find an answer

here is a picture of the window with the conversation text field

enter image description here

Upvotes: 1

Views: 1286

Answers (1)

John Snow
John Snow

Reputation: 5334

Just noticed that you are using a JTextField. JTextField is a single line and will hence print the text that appears to be center aligned. You should be using a JTextArea instead that that is multi-lineand it will solve your problem

Upvotes: 3

Related Questions