This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

line breaks in textfields?

 
steve tang
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I make a line break in a textfield?
I want to make something like a list that requires line breaks and I want to add it to the end of a string

moveString += "(" + (k1 + 1) + "," + (k2 + 1) + ") " +\r\n; doesn't work

Thanks
 
Timmy Marks
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't know if this will solve your problem, but the \n should be in quotes as well:

moveString += "(" + (k1 + 1) + "," + (k2 + 1) + ")\n";

You probably don't need the \r.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are we talking about AWT, Swing, SWT, HTML or something different here?

Anyway, in most, if not all, of those, textfields can't show more than one line - you'll need a textarea for that.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic