• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can lines be warping inside paint()?  RSS feed

 
Shay Gaghe
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI
I need to draw a string in multiple line. I tried to use � \n� but it doesn�t warp to a new line like excepted. Do anyone know how to perform this warping?
Thanks
 
Michael Bruesch
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had this problem too. The only solution I found is that you have to use multiple drawString ("String", x, y) calls and calculate the x's and y's so that it appears that it simply wraps around to the next line. There may be a simpler solution, but I didn't find it.
 
Paul Bailey
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hmm. anyboyd else been able to get around this one?
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
LineBreakMeasurer and TextLayout classes. See the LineBreakMeasurer api for an example.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!