• Post Reply Bookmark Topic Watch Topic
  • New Topic

draw string inside a shape  RSS feed

 
Nathalie Monvoisin
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, i have this piece of code, i want to insert a text inside my shape. can anyone tell me how to proceed. thank you

 
Campbell Ritchie
Marshal
Posts: 55761
163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you have a reference to the objects representing those Shapes, you can find the bounding rectangles for them all and find their coordinates easily. At the simplest you can use the drawString method of Graphics.
Ellipse2D is a rectangle; if you don't believe me look at its API documentation. It will have methods to find its coordinates.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!