File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

drawChars and onclick

 
Robert Kennedy
Ranch Hand
Posts: 63
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Is it possible t o add an onclick handler (via a mask or directly to the text) to text rendered via drawChars.

if not how would i render a JLabel component at the precise coordinates as the drawChars woudl have rendered.

Thanks!
 
Maneesh Godbole
Saloon Keeper
Posts: 10971
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One possible way.
When you invoke drawChars, compute and store int bounds as a Rectangle.
Add a mouse listener to the container on which the chars are drawn
When the user clicks, check if the click was inside any of the rectangles
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic