1

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

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433

1 Answers1

3

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

John Snow
  • 5,214
  • 4
  • 37
  • 44