• Post Reply Bookmark Topic Watch Topic
  • New Topic

wrapping in g.drawString(g,x,y)  RSS feed

 
Ranganath Junpal
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

Is there any way to wrap string in g.drawString(stg,x,y) of the paintComponent(Graphics g) method. if so please let know with an example.

thank you
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, there's not. You'd have to do this yourself by breaking up the String and using multiple drawString() calls.

You might consider using a text component instead of raw drawing; for example, you can use HTML in a JLabel to get a multiline label.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!