Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Get String from an area drawn using Graphics.drawString(str, x, y)  RSS feed

 
Vinayak Sharma
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I trying to create an automation framework for a Applet Based Java Application. Now, from the screen I need to get the String drawn using Graphics.drawString(String str, int x, int y).

I can get the x & y coordinates, is there a way by which I can get the string drawn by the above method call on screen?

Thaks In Advance,
Vinayak
 
todd runstein
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Keep a copy of "str" along with the x and y of where you placed it. Once you draw the string with Graphics, it's just colored pixels, not text.

Hope that helps.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!